Wichert Akkerman wrote:
da = getattr('my_da_or_what_ever', context, None)
getattr(context, 'my_da_or_what_ever', None) works a bit better.
Note that getattr('foo', context, None) is wrong.
Wichert has the correct syntax; I didn't even pay attention to the
syntax originally. :)
Doesn't that only work within a PythonScript? I need access from
within a content type, ie. real Python code?
It's called acquisition and it works everywhere. Try it.
Zope-CMF maillist - Zope-CMF@lists.zope.org
See http://collector.zope.org/CMF for bug reports and feature requests