Le 30/01/2011 12:12, Vincent Pelletier a écrit :
> Le dimanche 30 janvier 2011 09:52:32, Stéphane Klein a écrit :
>> How can I append Persistent mechanism to this OrderedDict class ?
>
> You should probably read the code for PersistentMapping[1] and adapt it to
> OrderedDict's API.
>
> [1]
> http://svn.zope.org/ZODB/trunk/src/persistent/mapping.py?rev=113734&view=markup
>

Hi,

I'll try that :

     from collections import OrderedDict
     from persistent import Persistent

     class PersistentOrderedDict(OrderedDict, Persistent):
         pass

but I've this error :

     TypeError: Error when calling the metaclass bases
         multiple bases have instance lay-out conflict

Then, I can't do like "persistent.mapping.PersistentMapping"

     class PersistentMapping(UserDict.IterableUserDict, 
persistent.Persistent)"

I need to create
PersistentOrderedDict that need to be a "proxy" class over OrderedDict, 
and a child on Persistent ?

Regards,
Stephane

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

_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev

Reply via email to