[ZODB-Dev] I would like append an indexer with uuid key at root of my ZODB, how can I append an function to commit event to update this uuid catalog ?

2011-06-28 Thread Stéphane Klein
Hi, I use ZODB to record some Resources. All my Resources have an uuid field. All work well but I would like append a BTree to ZODB root object to index uuid of all my resources. I would like record to this BTree index only Resources commited to ZODB database. How can I connect a function

Re: [ZODB-Dev] I would like append an indexer with uuid key at root of my ZODB, how can I append an function to commit event to update this uuid catalog ?

2011-06-28 Thread Thierry Florac
I use ZODB to record some Resources. All my Resources have an uuid field. All work well but I would like append a BTree to ZODB root object to index uuid of all my resources. I would like record to this BTree index only Resources commited to ZODB database. How can I connect a function

Re: [ZODB-Dev] I would like append an indexer with uuid key at root of my ZODB, how can I append an function to commit event to update this uuid catalog ?

2011-06-28 Thread Alexandru Plugaru
Hi Stéphane, Maybe this will be helpful: http://www.zodb.org/documentation/articles/ZODB2.html#persistent-aware-types 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. def get_uuid(uuid, context): resource_path

Re: [ZODB-Dev] I would like append an indexer with uuid key at root of my ZODB, how can I append an function to commit event to update this uuid catalog ?

2011-06-28 Thread Stéphane Klein
Le 28/06/2011 10:21, Thierry Florac a écrit : I use ZODB to record some Resources. All my Resources have an uuid field. All work well but I would like append a BTree to ZODB root object to index uuid of all my resources. I would like record to this BTree index only Resources commited to

Re: [ZODB-Dev] I would like append an indexer with uuid key at root of my ZODB, how can I append an function to commit event to update this uuid catalog ?

2011-06-28 Thread Pedro Ferreira
you’re responsible for keeping track of which objects map to which document id yourself. = it is this part I would like to implement. Maybe this will help: http://static.repoze.org/catalogdocs/overview.html#indexing But, as Alexandru suggests, maybe an OOBTree would be enough for your case.

Re: [ZODB-Dev] I would like append an indexer with uuid key at root of my ZODB, how can I append an function to commit event to update this uuid catalog ?

2011-06-28 Thread Stéphane Klein
Le 28/06/2011 11:25, Pedro Ferreira a écrit : you’re responsible for keeping track of which objects map to which document id yourself. = it is this part I would like to implement. Maybe this will help: http://static.repoze.org/catalogdocs/overview.html#indexing It's the same doc that I

Re: [ZODB-Dev] I would like append an indexer with uuid key at root of my ZODB, how can I append an function to commit event to update this uuid catalog ?

2011-06-28 Thread Pedro Ferreira
It's the same doc that I send in my previous mail. Oh sorry... anyway, why don't you store this UIID in the object itself? Then you can just retrieve the UUIDs of any result set in O(n). Cheers, Pedro -- José Pedro Ferreira Software Developer, Indico Project http://indico-software.org

Re: [ZODB-Dev] I would like append an indexer with uuid key at root of my ZODB, how can I append an function to commit event to update this uuid catalog ?

2011-06-28 Thread Thierry Florac
In repoze.catalog documentation, I read : Note that when you call index_doc, you pass in a docid as the first argument, and the object you want to index as the second argument. When we index the peach object above we index it with the docid 1. Each docid must be unique within a catalog;

Re: [ZODB-Dev] I would like append an indexer with uuid key at root of my ZODB, how can I append an function to commit event to update this uuid catalog ?

2011-06-28 Thread Stéphane Klein
Le 28/06/2011 13:13, Thierry Florac a écrit : In repoze.catalog documentation, I read : Note that when you call index_doc, you pass in a docid as the first argument, and the object you want to index as the second argument. When we index the peach object above we index it with the docid 1.

Re: [ZODB-Dev] I would like append an indexer with uuid key at root of my ZODB, how can I append an function to commit event to update this uuid catalog ?

2011-06-28 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/28/2011 05:21 AM, Stéphane Klein wrote: In repoze.catalog documentation, I read : Note that when you call index_doc, you pass in a docid as the first argument, and the object you want to index as the second argument. When we index the

Re: [ZODB-Dev] I would like append an indexer with uuid key at root of my ZODB, how can I append an function to commit event to update this uuid catalog ?

2011-06-28 Thread Jim Fulton
On Tue, Jun 28, 2011 at 3:50 AM, Stéphane Klein steph...@harobed.org wrote: Hi, I use ZODB to record some Resources. All my Resources have an uuid field. What is this? An integer? If so, how many bits? A string? A common strategy is to use integers as ids. All work well but I would like