Only thing I can think of is generate your own id. Doesn't have to be random, you can simply increament a counter every time you create a new instance. If you're worried about the id growing too long you can search the database for unused ids that are lower than the current value of the counter.
<br><br>Perhaps somebody else has a better idea.<br><br><div><span class="gmail_quote">On 24/06/06, <b class="gmail_sendername">Robert Gravina</b> &lt;<a href="mailto:robert@gravina.com">robert@gravina.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">This is an old thread, but I am finally tackling the round trip<br>editing problem and unfortunately getting nowhere. Basically, I want
<br>to be able to create some object on one machine, then send it off to<br>another (who edits some of the attributes) then when the other<br>machine calls a method on the original machine and passes it the<br>updated object, I can identify it simply by comparing for quality.
<br>Think of your basic client/server database application.<br><br>The Twisted howtos make the claim that &quot; Copyable objects return<br>unchanged from a round trip&quot;, and can be compared for quality like<br>(obj == obj) but in all my attempts I can get this to work (they are
<br>never equal). Does someone know of some sample code where this is<br>done successfully? It is done successfully with pb.Referenceables in<br>the howtos (look for the pb2client.py and pb2server.py listings).<br><a href="http://twistedmatrix.com/projects/core/documentation/howto/pb-usage.html">
http://twistedmatrix.com/projects/core/documentation/howto/pb-usage.html</a><br><br>Since I'm using the ZODB, I've tried using ZODB's _p_oid attribute to<br>identify objects that come back to me but the _p_oid is&nbsp;&nbsp;None even
<br>after a transaction.commit() (since the object hasn't been persisted<br>yet probably).<br><br>I could also create my own ID attribute and attempt to generate a<br>random ID and compare that, but this is most definately a hack.
<br><br>I am really having trouble progressing with my application because of<br>this problem. I'd really appreciate some insight on how to go about<br>solving this. Admittedly I'm not all that experienced with Twisted,<br>
but I thought this kind of thing was supposed to be straightforward.<br>What am I doing wrong?<br><br>Thanks,<br><br>Robert<br><br>On 2006/05/07, at 18:55, Micky Latowicki wrote:<br><br>&gt; It's possible to make each element in the set being edited a
<br>&gt; cacheable. If you think that would introduce too much overhead, then<br>&gt; you can add a method to the &quot;address book&quot; object which updates one of<br>&gt; the entries in this address book, and uses an id to identify the entry
<br>&gt; within the address book. So the address book is the dict. That's what<br>&gt; I did in a similar case. I'm no expert though.<br>&gt;<br>&gt; HTH<br>&gt;<br>&gt; Micky<br>&gt; _______________________________________________
<br>&gt; Twisted-Python mailing list<br>&gt; <a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>&gt; <a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
</a><br><br><br>_______________________________________________<br>Twisted-Python mailing list<br><a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br><a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python">
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br></blockquote></div><br>