[Zope-CMF] Accessing the "context"
Andrew Sawyers
andrew at sawdog.com
Tue Oct 30 11:58:18 EDT 2007
Wichert Akkerman wrote:
> Previously Charlie Clark wrote:
>
>> Am 30.10.2007 um 16:19 schrieb robert rottermann:
>>
>>
>>> da = getattr('my_da_or_what_ever', context, None)
>>>
>
> getattr(context, 'my_da_or_what_ever', None) works a bit better.
>
>
>> 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.
>
It only works if the context is wrapped properly. :)
> Wichert.
>
>
Andrew
More information about the Zope-CMF
mailing list