Dennis Schulz wrote:
I found no example how to define it in the class generally for all
instances
i would like to access the supplier container under a different name
inside one instance of Purchase Requisition.
class PurchaseRequisition( SimpleItem, Implicit ):
suppliers = property ( lambda self: str(
self.context.aq_inner.aq_parent.supplier) )
Keep it simple like Andreas suggested::
from Acquisition import aq_inner, aq_parent
class PurchaseRequisition( SimpleItem, Implicit ):
def suppliers(self):
parent = aq_parent(aq_inner(self))
return parent.supplier
# does exactly the same thing thanks to automatic
# acquisition:
def suppliers(self):
return self.supplier
Andreas Jung escribió:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
- --On 13. Dezember 2006 19:12:13 +0100 Dennis Schulz
<[EMAIL PROTECTED]> wrote:
Hi
I want to acquire an persistent zope object (supplier) that is inside my
productfolder
myproductfolder/supplier
How to get a reference to this object? Also, Is there a method to get
the
product root?
context.myproductfolder.supplier?
That's basic acquisition and should be documented in the Zope Book:
<http://www.plope.com/Books/2_7Edition/Acquisition.stx>
- -aj
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)
iD8DBQFFgEOjCJIWIbr9KYwRAs/LAJ9ROWS1ArpGH/Mf5+7CesUjXRdGTwCg6U66
BUalSLllgOaxmn4C0kBiCns=
=E1/0
-----END PGP SIGNATURE-----
_______________________________________________
Zope maillist - [email protected]
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 )
--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
_______________________________________________
Zope maillist - [email protected]
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 )