[Zope] Problems with list of object references

Max M maxm@mxm.dk
Wed, 14 Aug 2002 10:59:27 +0200


Sven Rudolph wrote:

>>def getLatestNews(self):
>>    # converts paths to objects
>>    return [self.getPhysicalRoot().restrictedTraverse(path) for path in 
>>self.latestNews]
>>    
>>
>I was thinking about your suggestion to use ZCatalog. Isn't the attribute data_record_id_ some kind of object reference? It seems to be unique and static. Do you now how it is generated?
>  
>

My guess is that it is a key to an object in the ZCatalog, which then 
has the path stored :-/

The problem is that the only unique id for an object in Zope is the 
path. There is a global object id, but you cannot trust it. Ie. when an 
object is imported/exported it get weird. Or when you use another 
storage etc.

You should really only store the nessecary metadata in the Catalog ie. 
just enough to view an object in a list. Do you really need the full 
object to be envoked/rendered in that 100 article list?

regards Max M

    "klaatu verata niktu"