[Zope-dev] PROPOSAL: ZODB Relationships

Jean Jordaan jean@upfrontsystems.co.za
Fri, 09 May 2003 11:06:27 +0200


> Very interesting. What I miss is a way to name the relationship so you 
> can specify which relationship you are interested in. 

Isn't this naming the relationship?

             student_courses = Relationship()

So you can examine the relationship you are interested in by finding
it in the repository for relationships (eg. in a folder) as:

   <relationshipfolder>.student_courses
   <relationshipfolder>.course_teachers


> to. The RelationshipViews partially solve this, but require you to load 

   pete.courses

and

   student_courses.get(pete)

are different ways of saying the same thing. If you set a
RelationshipView on an object, you can use both ways, but the first
way is the shortest and most pythonic. For 3rd party objects that
are ignorant of relationships, you must use the second way.

> I have missed this type of functionality, but I always saw it as an 
> extention to the Catalog, so that you could query not only on indexesd 
> metadata, but also on relationships to other objects. 

It is akin to the Catalog, but the proposal aims to provide
relationships in the absence of Zope and the Catalog as well.
Also, relationships are bidirectional, which a Catalog is not.

-- 
Jean Jordaan
http://www.upfrontsystems.co.za