[Zope3-dev] How to resolve bi-directionally navigable association?

Stephan Richter srichter at cosmos.phy.tufts.edu
Sun Aug 28 16:15:16 EDT 2005


On Monday 08 August 2005 12:43, Adam Groszer wrote:
> class IItem(interface):
>     unit = Object(
>         title=u"Unit",
>         description=u"Unit",
>         required = False,
>         schema=IUnit)
>
> class IUnit(interface):
>     item = Object(
>         title=u"Item",
>         description=u"Item",
>         required = False,
>         schema=IItem)
>
> but obviously that does not work, I cannot define one before the
> other.

In IItem specify "Interface" as the schema. After you defined IUnit you can do 
something like:

IItem.getDescriptionFor('unit').schema = IUnit

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training


More information about the Zope3-dev mailing list