[ZODB-Dev] Re: getting the object ID (_p_oid attribute)
Florent Guillaume
fg at nuxeo.com
Mon Jun 26 14:16:57 EDT 2006
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 way to get an object ID *before* an object has been
> persisted?
You can call container._p_jar.add(yourobject) to have it get an oid
before commit time.
Florent
--
Florent Guillaume, Nuxeo (Paris, France) Director of R&D
+33 1 40 33 71 59 http://nuxeo.com fg at nuxeo.com
More information about the ZODB-Dev
mailing list