[Zope] script to create tuple of Objects
Trevor Toenjes
zope@toenjes.com
Fri, 25 Jan 2002 20:40:39 -0500
I am using Formulator(which requires a tuple) to create a list of objects
and still learning python scripts. and stuck.
I am trying to create a master script to exist in Root that will create a
list of objects from a Folder with a given ObjectType. like zClasses,
DTML_Methods, or DTML_Docs.
script- tuple_of_items called in Override
##parameters=myFolder, myObjectType
results=[]
for object in container.myFolder.objectValues('myObjectType'):
tuple = object.title, object.id
results.append(tuple)
return results
in the Items Override I enter>>
tuple_of_items('idofTargetFolder','DTML_Method')
I get an attribute error. Please help me with what I have missed?
If I dont pass the parameters and hardcode in the script:
The form renders properly, but on Submit, I get the error>>
unknown_selection You selected an item that was not in the list.
What is causing this?
Thank you,
Trevor