Help!!! I am using the Formulator product in an attempt to create a MulitListField which will select from a list of topics, which are properties of the documents in a folder. The override method is a python script: results=[] for object in context.objectValues('STX_Document'): if object.getProperty('topic') != '': tuple = object.topic, object.topic if tuple not in results: results.append(tuple) results.sort() return results The script works in the "Python Script" manage window when I select the "test" tab. But when I actually run the DTML file that calls the form, I get an empty multi-list field. I've downloaded the Wing IDE and stepped through code: it seems to have identified the override method properly, but it doesn't seem to do anything with it. The form code follows: <table border="0"> <dtml-in "form.get_fields()"> <dtml-let field=sequence-item> <tr> <td><b>Sort by <dtml-var "field.get_value('title')"></b></td> </tr> <tr> <td><dtml-var "field.render()"></td> <td><dtml-var "field.get_value('description')"></td> </tr> </dtml-let> </dtml-in> <tr> <td><input type="submit" value="Select"></td> </tr> </table> <dtml-var "form.footer()"> Am I doing something wrong???
cgreen writes:
... The override method (for "Formulator") is a python script:
for object in context.objectValues('STX_Document'): ....
The script works in the "Python Script" manage window when I select the "test" tab. But when I actually run the DTML file that calls the form, I get an empty multi-list field. I expect, "context" is different when the script is used inside the Formulator. Maybe, the use of "container" (instead of "context") solves your problem.
Dieter
Dieter; Dude!!! You totally f---in' ROCK, man!!! That was completely it..... my non-programming 'self' would have *never* figured that out -- "container" instead of "context". That's what happens when you (I) cut-and-paste code instead of understanding it.... Thank you, thank you THANK YOU! If you are ever in the New York City area, I owe you dinner! peace
cgreen writes:
... The override method (for "Formulator") is a python script:
for object in context.objectValues('STX_Document'): ....
The script works in the "Python Script" manage window when I select the "test" tab. But when I actually run the DTML file that calls the form, I get an empty multi-list field. I expect, "context" is different when the script is used inside the Formulator. Maybe, the use of "container" (instead of "context") solves your problem.
Dieter
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
cgreen -
Dieter Maurer