You are here: Home Plone products BiReference

BiReference (0.1)

1
by Olha Pelishok last modified 2010-03-31
5.0
4.0
4.0
3.0
Released on 2008-12-12 by Dylan Jay for Plone 2.5 under Zope Public License (ZPL) available for All platforms.
Software development stage: stable
Implements BiDirectional/Unidirectional references in Archetypes. Acts as a drop in replacement for ReferenceField and BackReferenceField and is perfect for self referential relationships.

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.

Document Actions
Powered by Plone