getattr in Python Method problem
In the folder where dosomething_pym (Python Method) is located, is also a string property set called 'en' with the value 'English' The Python Method object is called with no parameters, but is defined with the 'self' parameter inside the Python Method object. In a DTML Method this works fine: <dtml-var "_.getitem('en')"> and returns "English" This is what I try in the Python Method: lang=getattr(self,'en') but this raises an error! Error Type: AttributeError Error Value: validate I have searched the mailing list but in vain. Some people say it should be lang=getattr(self,'en')(self,REQUEST) But that raises the same error. Best regards, Peter
I keep getting flummoxed by the tutorials on how to create ZClasses... Is there a really simple product, maybe with just 2 classes (with say 4 properties each)...with methods to create, edit and update....and list....with super simple HTML, (i.e no/few tables to have to scroll around in the editing textarea) I think I understand all the concepts, but I keep getting tripped up by dumb syntax...so I then have to start back at the beginning... thanks tom
tom smith wrote:
I keep getting flummoxed by the tutorials on how to create ZClasses...
Is there a really simple product, maybe with just 2 classes (with say 4 properties each)...with methods to create, edit and update....and list....with super simple HTML, (i.e no/few tables to have to scroll around in the editing textarea)
I think I understand all the concepts, but I keep getting tripped up by dumb syntax...so I then have to start back at the beginning...
thanks
Not a simple example, but you may want to look at Maik Roeder's ZDPTools for more examples than you care of: http://www.zope.org/Members/roeder/ hth Rik
The URL Directory is simple and easy to learn from. Search the zope.org site. / P
I keep getting flummoxed by the tutorials on how to create ZClasses...
Is there a really simple product, maybe with just 2 classes (with say 4 properties each)...with methods to create, edit and update....and list....with super simple HTML, (i.e no/few tables to have to scroll around in the editing textarea)
I think I understand all the concepts, but I keep getting tripped up by dumb syntax...so I then have to start back at the beginning...
thanks
tom
_______________________________________________ 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 (4)
-
peter bengtson -
Peter Bengtsson -
Rik Hoekstra -
tom smith