[Zope] [ADVANCED] How do YOU guys do many-to-many in Zope without relational?
Max M
maxmcorp@worldonline.dk
Mon, 22 Oct 2001 23:40:42 +0200
> From: Casey Duncan [mailto:c.duncan@nlada.org]
> They way to do this is to create a lines property in the student
> and store
> the ids of the related subjects there. You use a ZCatalog and a
> keyword index
> on this property to quickly find which students belong to which subject.
Again only if the id's are unique all over the site.
> 2. Assign another fixed key as a property (or general attribute) of the
> subject for use as the unique identifier and don't ever change it for the
> life of the object.
There allready exist such a key for each object in the ZODB called the oid,
but I don't think that it's easy to get at through normal means. I am not
even shure that it's "allowed" to use it for anything.
> You will need to use a ZCatalog to make
> lookups on this
> id efficient, but this would allow you to put the object anywhere
> you like,
> and rename them without screwing up the relationships. Only
> deletion would
> break it.
Deletion always has a tendency to do this. I need triggers in the ZODB :-)
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