Re: [pylons-discuss] ZODB, maintaining referential integrity

2016-04-21 Thread Thierry Florac
Hi ! I often use internal IDs (via an IIntIds utility) to store objects references. The drawback of this method is that you have an indirection and you always have to check that the reference target is still available before using it! So even in this use case I use an event listener to remove the

Re: [pylons-discuss] ZODB, maintaining referential integrity

2016-04-21 Thread Chris Rossi
The other approach would be to only store objects in one canonical place, and use references that just store the path to the object or the oid. Chris On Thu, Apr 21, 2016 at 3:36 AM, Joe Steeve wrote: > How to maintain "referential integrity" in a ZODB. Simply put: When an >

Re: [pylons-discuss] ZODB, maintaining referential integrity

2016-04-21 Thread Thierry Florac
Hi, Actually I handle this use case using IObjectRemovedEvent subscribers. Can't see any other simple way... :-/ Best regards, Thierry 2016-04-21 9:36 GMT+02:00 Joe Steeve : > How to maintain "referential integrity" in a ZODB. Simply put: When an > object-A is removed from

[pylons-discuss] ZODB, maintaining referential integrity

2016-04-21 Thread Joe Steeve
How to maintain "referential integrity" in a ZODB. Simply put: When an object-A is removed from a container, the references to object-A, in other objects should go invalid. I tried holding a persistent.WeakRef whenever a reference was required. However, the WeakRef seems to go invalid only after