R: [Zope] Discussion: Best practice site struture (LONG)

Thomas Guettler zopestoller@thomas-guettler.de
Thu, 11 Apr 2002 12:57:37 +0200


Max M wrote:

> Adam Manock wrote:
> 
>> This kind of analysis of the data set that we want to work with, along 
>> with the practice of mapping the analysis to tables, attributes and 
>> constraints is well established in the RDBMS world.
>> I have yet to get my head around mapping a complicated data set and 
>> the relationships between the data elements to an object database, 
>> like the ZODB :-) So, for now at least, the answer is   PostgreSQL, 
>> and we use it *alot*.
> 
> 
> 
> Well in fact it is VERY easy to do in the ZODB. My mxmRelations product 
> does exactly this.
> 
> Only, a product like that should be in the core.


You can get use ZCatalog.

Every objects needs a unique ID. For example "unique_id"

Then the objects which refere to other objects have a list
called "referenced_ids"

Make an index for unique_id and referenced_ids.

The two directions:

1. Finding the referenced objects: "for ref in referenced_ids: ..."

2. Finding the objects which refere to a given ID:
  Use ZCatalog.searchResults(referenced_ids=given_id)


Maybe you could use catalogAware.getPath() instead of unique_id.

thomas