[Zope] Follow-up to aq_parent(aq_inner(self))-question

Andreas Jung lists at andreas-jung.com
Sun Jul 24 09:33:49 EDT 2005



--On 24. Juli 2005 15:27:32 +0200 Jan-Ole Esleben <esleben at gmail.com> wrote:

> Hi!
>
> How can I get the product's path while instantiating it? Shouldn't
> this information exist somewhere? aq_parent(aq_inner(self)) returns
> None, which isn't totally unexpected since __init__ isn't strictly a
> Zope method and thus doesn't necessarily have a Zope method's context.
>
> (I need, from the __init__ method of a product, to find out its
> instantiation path in the ZODB.)
>

Use manage_afterAdd(). There is no acquistion context available during the
construction phase where __init__() is used.

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20050724/aee31378/attachment.bin


More information about the Zope mailing list