[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 ?

Stéphane Klein stephane at harobed.org
Tue Jun 28 08:09:57 EDT 2011


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. Each docid
>> must be unique within a catalog; when you query a repoze.catalog
>> catalog, you’ll get back a sequence of document ids that match the query
>> you supplied, which you’ll presumably need to map back to the content
>> object in order to make sense of the response; you’re responsible for
>> keeping track of which objects map to which document id yourself.
>> """
>> Url : http://docs.repoze.org/catalog/overview.html#indexing
>>
>> "you’re responsible for keeping track of which objects map to which
>> document id yourself." =>  it is this part I would like to implement.
>
> This last part is handled by zope.intid package, which is used internally
> by zope.catalog.
> When a persistent IntId utility has been created and registered, you can
> do what you need :
>   - get a unique ID (an integer) for a given object (when persisted !)
>   - get an object for a given ID
>

I'm not in zope environment, I use Pyramid + ZODB. Can I use easily this 
tools in my context ?

Regards,
Stephane

-- 
Stéphane Klein <stephane at harobed.org>
blog: http://stephane-klein.info
Twitter: http://twitter.com/klein_stephane
pro: http://www.is-webdesign.com



More information about the ZODB-Dev mailing list