BiReference (0.1)
- BiReference download link: http://plone.org/products/bireference/releases
- Homepage of BiReference: http://plone.org/products/bireference/
- BiReference repository: https://svn.plone.org/svn/collective/BiReference
- Description source: https://svn.plone.org/svn/collective/BiReference/trunk/README.txt
Purpose
Implements BiDirectional/Unidirectional references in Archetypes. Acts as a drop in replacement for ReferenceField and BackReferenceField and is perfect for self referential relationships.
Installation
unpack the archive into youe zope's Products dir, install Archetypes + BiReference inside your portal with QuickInstaller
Usage
- in your UML tool create a relation between 2 classes and make the 'to' end of the assoc navigable (such a beast is provided in the sample dir). You can also point the referense to the same class.
- set back_reference_field and reference_field to BiReferenceField (with appropriate imports tags)
- you will need to set the widget to BiReferenceWidget or a compatible reference widget (see below)
- invoke ArchGenXML (version 1.2, at the date of the writing you must download it from svn.plone.org from the trunk):: python ArchGenXML/ArchGenXML --back-references-support ATBackRef/sample/atbackref.zuml BackRefSample
- restart your zope and try it out
- you will notice that references can be created at either end and are viewable at either end
Caveats - It won't work with many existing reference widgets such as PopupReferenceWidget. Most reference widgets don't use the fields accessor to get the references and instead assume they can get the references from the reference tool directly. It will work with SearchReferenceWidget.