[Zope] RE: Getting an object indirectly in a PythonMethod

Jay, Dylan djay@lucent.com
Thu, 4 Nov 1999 14:14:38 +1100


nope, eval seems to be not available. Prob for security reasons.

> -----Original Message-----
> From: Cayce Ullman [mailto:c_ullman@yahoo.com]
> Sent: Thursday, November 04, 1999 14:11
> To: zope@zope.org
> Cc: djay@lucent.com
> Subject: Getting an object indirectly in a PythonMethod
> 
> 
> 
> Untested, but, try :
> 
>  return eval(self.ObjNameProperty)
> 
> That should work.
> 
> Cayce
> 
> <I have a python method as part of a ZClass. I want
> this method to return an
> <object whose id is stored in a ZClass property. In
> DTML this would be as
> <simple as <dtml-return "_[ObjNameProperty]">
> <I can't figure out how to do this in a python method.
> Things such as
> <self.getattr(ObjNameProperty) don't seem to work at
> all.
> 
> 
> 
> =====
> 
> __________________________________________________
> Do You Yahoo!?
> Bid and sell for free at http://auctions.yahoo.com
>