[Zope] [ADVANCED] How do YOU guys do many-to-many in Zope without relational?

Max M maxmcorp@worldonline.dk
Mon, 22 Oct 2001 21:44:04 +0200

I am in the situation where I have to do what corresponds to a many-to-many
relation in Zope.

I basically have two zClassses. students and subjects. There can be many
subjects, and in any subject there can be any number of students.

What I do now is having a studentlist under each subject. But this doesn't
really work because any single student can belong to any number of subjects.

So if this was an ordinary relational db it would be many to many.

Now I considder making a global student list and then do a recursive search
for subjects in the site, so that each student can be related to a subject
with a selectbox or somesuch.

But if someone renames, deletes or moves a subject I am f.*?d Or the student
is. The relation to the subject is invalidated.

I have never seen it used, but would it be possible to store the "global
object id" in a list in a user object, and then get the path to the subject
object from that?

Or should I make the subject a global list to? That way I only have to check
if the object exists or not. Not where it is in the object hierachy.

This sort of defeats the purpose of Zope's tree like structure. Doesn't it?

So, how do YOU guys do many-to-many in Zope ?

regards Max M

Max M. W. Rasmussen,    Denmark.   New Media Director
private: maxmcorp@worldonline.dk work: maxm@normik.dk
Shipping software is an unnatural act