Hi Stéphane,<div><br></div><div>Maybe this will be helpful: <a href="http://www.zodb.org/documentation/articles/ZODB2.html#persistent-aware-types">http://www.zodb.org/documentation/articles/ZODB2.html#persistent-aware-types</a></div>

<div>I think what you are looking for is an OOBTree with the key being your uuid and the  value being the path to your Resources object.</div><div><br></div><div>def get_uuid(uuid, context):</div><div>   resource_path = context.my_btree.get(uuid, None)</div>

<div>   if uuid is not None:</div><div>       return context.unrestrictedTraverse(resource_path)</div><div><br></div><div>You can get the path of an object in OFS by calling absolute_url method of that object.</div><div>
<br>
</div><div>Hope this helps,</div><div>Alex.</div><div><br><div class="gmail_quote">On 28 June 2011 12:10, Stéphane Klein <span dir="ltr">&lt;<a href="mailto:stephane@harobed.org">stephane@harobed.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Le 28/06/2011 10:21, Thierry Florac a écrit :<br>
<div class="im">&gt;&gt; I use ZODB to record some Resources.<br>
&gt;&gt;<br>
&gt;&gt; All my Resources have an &quot;uuid&quot; field.<br>
&gt;&gt;<br>
&gt;&gt; All work well but I would like append a BTree to ZODB root object to<br>
&gt;&gt; &quot;index&quot; uuid of all my resources.<br>
&gt;&gt;<br>
&gt;&gt; I would like record to this BTree index only Resources commited to ZODB<br>
&gt;&gt; database.<br>
&gt;&gt;<br>
&gt;&gt; How can I connect a function to &quot;commit&quot; event ?<br>
&gt;&gt; In this function, how can I found all object modified ?<br>
&gt;&gt; How can I found all object removed to the database ?<br>
&gt;&gt;<br>
&gt;&gt; Other question : are there already a package to perform this task ?<br>
&gt;<br>
&gt;<br>
&gt; The matching package is zope.catalog.<br>
&gt; It provides all you need (catalog and indexes) to handle your task.<br>
&gt; Objects creations and modifications are followed automatically by several<br>
&gt; subscribers as soon as this package is correctly registered.<br>
&gt; z3c.catalog and hurry.query packages can be good extensions packages to<br>
&gt; look at...<br>
<br>
</div>I&#39;ve already looked zope.catalog and repoze.catalog.<br>
<br>
Question : I haven&#39;t docid, can I use uuid here ? but it isn&#39;t the<br>
feature I want : I would like retrieve my object from uuid.<br>
<br>
Do you have an example of code about it ?<br>
<br>
More information about my aim :<br>
<br>
root (ZODB)<br>
   uuid =&gt; { &quot;uuid_value1&quot;: resource_A, &quot;uuid_value2&quot;: resource_B, ... }<br>
   folder_1<br>
     resource_A<br>
     folder_2<br>
       resource_B<br>
<br>
I would like this function :<br>
<br>
 &gt;&gt;&gt; get_by_uuid(&quot;uuid_value1&quot;)<br>
=&gt; return resource_A<br>
<br>
Regards,<br>
<div class="im">Stephane<br>
<br>
--<br>
Stéphane Klein &lt;<a href="mailto:stephane@harobed.org">stephane@harobed.org</a>&gt;<br>
blog: <a href="http://stephane-klein.info" target="_blank">http://stephane-klein.info</a><br>
Twitter: <a href="http://twitter.com/klein_stephane" target="_blank">http://twitter.com/klein_stephane</a><br>
pro: <a href="http://www.is-webdesign.com" target="_blank">http://www.is-webdesign.com</a><br>
<br>
_______________________________________________<br>
</div><div><div></div><div class="h5">For more information about ZODB, see the ZODB Wiki:<br>
<a href="http://www.zope.org/Wikis/ZODB/" target="_blank">http://www.zope.org/Wikis/ZODB/</a><br>
<br>
ZODB-Dev mailing list  -  <a href="mailto:ZODB-Dev@zope.org">ZODB-Dev@zope.org</a><br>
<a href="https://mail.zope.org/mailman/listinfo/zodb-dev" target="_blank">https://mail.zope.org/mailman/listinfo/zodb-dev</a><br>
</div></div></blockquote></div><br></div>