robert rottermann wrote:
Charlie Clark schrieb:
a simple question with hopefully a simple answer! How do I access
objects from an object's context or hierarchy? Specifically I'd like to
be able to access a ZopeDA connection for a site.
if you know the id of the object you are looking for beforehand you can
get it by just requesting it from the context like:
da = getattr('my_da_or_what_ever', context, None)
i strongly recommend "if da is not None" rather than just "if da".
if your 'da' object was a containerish object with no contained objects, then
it would evaluate to False even though the object really existed. it's
generally unwise to assume that an object will evaluate to True just because
Zope-CMF maillist - Zope-CMF@lists.zope.org
See http://collector.zope.org/CMF for bug reports and feature requests