Re: [ZODB-Dev] Re: getting the object ID (_p_oid attribute)

2006-06-26 Thread Florent Guillaume
On 26 Jun 2006, at 21:28, Robert Gravina wrote: def __eq__(self, other): if isinstance(other, ): if hasattr(other,"_p_oid") and other._p_oid != None and (other._p_oid == self._p_oid): return True else: return False and now ca

Re: [ZODB-Dev] Re: getting the object ID (_p_oid attribute)

2006-06-26 Thread Robert Gravina
def __eq__(self, other): if isinstance(other, ): if hasattr(other,"_p_oid") and other._p_oid != None and (other._p_oid == self._p_oid): return True else: return False and now can compare objects for equality after the (Twisted

[ZODB-Dev] Re: getting the object ID (_p_oid attribute)

2006-06-26 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Robert Gravina wrote: > > On 2006/06/27, at 3:49, Benji York wrote: > >> Robert Gravina wrote: >>> I just tried loading a persisted object interactively and noticed >>> that although the _p_oid doesn't print out as anything (and hence I >>> always

Re: [ZODB-Dev] Re: getting the object ID (_p_oid attribute)

2006-06-26 Thread Gary Poster
On Jun 26, 2006, at 3:16 PM, Florent Guillaume wrote: On 26 Jun 2006, at 21:11, Robert Gravina wrote: On 2006/06/27, at 3:49, Benji York wrote: Robert Gravina wrote: I just tried loading a persisted object interactively and noticed that although the _p_oid doesn't print out as anything

Re: [ZODB-Dev] Re: getting the object ID (_p_oid attribute)

2006-06-26 Thread Gary Poster
On Jun 26, 2006, at 3:11 PM, Robert Gravina wrote: I seemed to have solved this problem. I was able to write a __eq__ function like this: def __eq__(self, other): if isinstance(other, ): if hasattr(other,"_p_oid") and other._p_oid != None and (other._p_oid == self._

Re: [ZODB-Dev] Re: getting the object ID (_p_oid attribute)

2006-06-26 Thread Florent Guillaume
On 26 Jun 2006, at 21:11, Robert Gravina wrote: On 2006/06/27, at 3:49, Benji York wrote: Robert Gravina wrote: I just tried loading a persisted object interactively and noticed that although the _p_oid doesn't print out as anything (and hence I always thought it was empty in my debugging

Re: [ZODB-Dev] Re: getting the object ID (_p_oid attribute)

2006-06-26 Thread Robert Gravina
On 2006/06/27, at 3:49, Benji York wrote: Robert Gravina wrote: I just tried loading a persisted object interactively and noticed that although the _p_oid doesn't print out as anything (and hence I always thought it was empty in my debugging prints), it isn't actually None! Can anyone

Re: [ZODB-Dev] Re: getting the object ID (_p_oid attribute)

2006-06-26 Thread Benji York
Robert Gravina wrote: I just tried loading a persisted object interactively and noticed that although the _p_oid doesn't print out as anything (and hence I always thought it was empty in my debugging prints), it isn't actually None! Can anyone explain this? (here "p" is my persisted object

[ZODB-Dev] Re: getting the object ID (_p_oid attribute)

2006-06-26 Thread Robert Gravina
On 2006/06/27, at 3:16, Florent Guillaume wrote: Robert Gravina wrote: I've been having trouble getting the object ID of persisted objects in the ZODB. I have read that the _p_oid attribute is supposed to contain this, but when I access persisted objects from a filestore and check this va

[ZODB-Dev] Re: getting the object ID (_p_oid attribute)

2006-06-26 Thread Florent Guillaume
Robert Gravina wrote: I've been having trouble getting the object ID of persisted objects in the ZODB. I have read that the _p_oid attribute is supposed to contain this, but when I access persisted objects from a filestore and check this value it always seems to be None. Also, is there any wa