[Zope3-Users] How do I find out references to objects in ZODB

Marius Gedminas mgedmin at b4net.lt
Fri May 2 12:59:46 EDT 2008


On Fri, May 02, 2008 at 10:17:46PM +0800, Yuan HOng wrote:
> Is it possible to find out what other objects are referencing a
> particular object in ZODB?

Not easily -- you'd have to traverse the object graph yourself to see if
you can find any references.

> In particular, I want to prevent some content objects, like images,
> from being removed from the folder if they are used in some other
> content object, like a news article.
> 
> Do I have to keep track of object referencing in ZODB myself through
> events or there are some built-in mechanism in ZODB to take care of
> this for me?

Your best bet is to keep track of this yourself.  Indexes and catalogs
may help.

Marius Gedminas
-- 
Given enough eyeballs all bugs are shallow.
                -- Eric S. Raymond, "The Cathedral and the Bazaar"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20080502/00b6c828/attachment.bin


More information about the Zope3-users mailing list