Author: Alec Mitchell



Tools for defining and querying complex relationships between objects. This
product builds on and requires zc.relationship and also five.intid.


Author: Alec Mitchell <>

Based on the index and relationship container from zc.relationship by
Gary Poster from Zope Corporation, and the port of the Zope intid utility
to Zope 2 by Whit Morriss in five.intid. This package includes a slightly
modified version of ``container.txt`` from zc.relationship which is copyright
Zope Corporation and distributed under the ZPL. The package was mostly
inspired by ideas in the doctests of that product.

This work was partly sponsored by The Daily Reel (


2.0 - 2011-10-06

- Updated to work with and require Zope 2.13.

1.0rc4 - unreleased

- Depend on setuptools as we use namespace packages.

- Depend on zc.relationship 1.1.1 or higher.

- Depend on zc.relationship 1.1.1 to allow support for ZODB 3.7 and 3.8.

1.0rc3 - 2008-12-06

- Peg to 1.0 versions of zc.relationship to maximize backwards
  compatibility for now.

1.0rc2 - unreleased

- 1.0rc2 was never released.

1.0rc1 - 2008-11-26

- Added a changelog and cleaned up package information boilerplate.

- Getting a relation could cause a write transaction. This solved

1.0b5 - 2008-05-10

- Removed unused import statements as reported by pyflakes.

- Don't assume an IntId already exists.

- Prep release with fixed dependencies, and new adapter based relationship

- Added support for relationships to proxy objects obtained using adaptation.

- It's not safe to use 'not target' when target could be a content item (e.g.
  a folderish one for which an empty folder is false). The new code is now
  identical to the same pattern used in zc.relationship.

- Update version and zc.relationship dependency.

- Remove collective.testing dependency.

- Use a savepoint not a full commit during test.

- We no longer guarantee that the relation objects themselves are wrapped on
  retrieval, only that they can be wrapped as needed.

- We need implicit acquisition in order to obtain getPhysicalRoot for
  workflow/template expressions.

- Remove getPhysicalPath methods as they are no longer needed, make the str
  representation of relationships show something reasonable even if some of
  the sources/targets are missing.

- Early contributions.
  [optilude, ramon, wichert]

- Initial implementation.

Detailed Documentation


This is a product built on the ``zc.relationship`` product for Zope 3.
It attempts to allow the functionality of that package to be used from
Zope 2, along with some simple additional functionality derived from
that package's basic relationship ``Index``.

The relationship container provided here is very similar to the one in
``zc.relationship``.  It is used to store and query objects
implementing or adaptable to the simple IRelationship interface, but
more complex relationships are supported as well.  This extra
functionality is defined in a few extensions to the IRelationship
interface.  These interfaces are described below:

    IRelationship defines a basic relationship consisting of
    only ``sources`` and ``targets``.  These are sequences of
    objects that comprise the relationship.  In the default
    implementation these must all be persistent objects from
    the ZODB (or more generally, objects for which and
    ``intid`` can be generated using the available ``IIntId``
    utility (cf ``zope.intid`` and ``five.intid``)).

    IComplexRelationship adds a relationship predicate to
    indicate the type of relationship involved.  This
    predicate is ret