[Zope] getattr in Python Method problem

Peter Bengtsson peter@grenna.net
Sun, 26 Nov 2000 20:26:18 -0000


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