I am trying to create a z-class (which resides in a product I have made) in a given folder through a python script. My syntax is obviously wrong (since it is not working), but alas I cannot find out what it is.. anyone? context.manage_addProduct['productName'].manage_z-class-constructor("spam") -jorg
Jorg E. Rødsjø writes:
I am trying to create a z-class (which resides in a product I have made) in a given folder through a python script.
My syntax is obviously wrong (since it is not working), but alas I cannot find out what it is.. anyone?
context.manage_addProduct['productName'].manage_z-class-constructor("spam") Hopefully, you do not write the "-" in your script...
Otherwise, the syntax does not look wrong. Do you pass the parameters to your constructor that it expects? When it were a DTML object, "spam" would be wrong and you should expect "Name/KeyError"s. Dieter
* Dieter Maurer <dieter@handshake.de>
context.manage_addProduct['productName'].manage_z-class-constructor("spam") Hopefully, you do not write the "-" in your script...
No, I do not.
Do you pass the parameters to your constructor that it expects? When it were a DTML object, "spam" would be wrong and you should expect "Name/KeyError"s.
I'm currently getting a "File /home/zope/lib/python/AccessControl/ZopeGuards.py, line 47, in guarded_getattr AttributeError: (see above)" I'm using the constructor which is generated automaticly when one adds a z-class to a product. And from what I can see, ID is the only required argument. -jorg
participants (2)
-
Dieter Maurer -
Jorg E. Rødsjø