[Zope] acquisition

Andreas Jung lists at zopyx.com
Wed Dec 13 14:32:26 EST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



- --On 13. Dezember 2006 19:56:40 +0100 Dennis Schulz <d.schulz81 at gmx.net> 
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) )

No idea what this (nonsense) code should do. Follow the standard road
and write a method

   def getSuppliers(self):
       return self.foo.bar.supplier


or use self.restrictedTraverse(path) if you are working with path
information.

- -aj
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)

iD8DBQFFgFVOCJIWIbr9KYwRAsSEAKDiitYhxB+/rcE/L/+Cw2f4reJmKwCfZljA
pBe8OXA5jWK9w7waXXC2V+o=
=zZf0
-----END PGP SIGNATURE-----



More information about the Zope mailing list