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

2005-07-24 Thread Jan-Ole Esleben
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.)

TIA,
Ole
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


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

2005-07-24 Thread Andreas Jung



--On 24. Juli 2005 15:27:32 +0200 Jan-Ole Esleben [EMAIL PROTECTED] 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

pgpnAnGEp6JyC.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )