[Zope] [ADVANCED] How do YOU guys do many-to-many in Zope without relational?
Mon, 22 Oct 2001 21:44:31 +0100
* Max M <email@example.com> [011022 20:44]:
> 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.
> So, how do YOU guys do many-to-many in Zope ?
This is what the ZCatalog is for:
For example, have a property for students which is a list of subject
ids. This makes it easy to list subjects by students. Now if you
make this property be an index on the ZCatalog, you can easily
retrieve all students by subject, too.