|
Re: conflict resolution for PersistentList: msg#00103web.zope.zodb
Diez B. Roggisch wrote at 2004-5-21 13:22 +0200: >after finding that my ConflictError was suppressed by a bad designed exception >handler, I now want to implement a _p_resolveConflict method. > >I implemented it, but can't work with the passed state. It looks like this: > >>>> print oldState >{'items': PR(1079757676 ('\x00\x00\x00\x00\x00\x00\x00\x02', <class >'persistent.list.PersistentList'>)), 'name': 'father'} > > >I want to iterate over the items-lists and merge them properly. However, I >can't access the items as list - its not iterable. The "states" handled by "_p_resolveConflict" are the pickles for your objects are stored by the ZODB storage. Usually, they are dicts with the object attributes. Note that persistent subobjects are represented by PersistentReferences (the "PR" above). These are *NOT* the subobjects themselves but just references. You cannot access the subobjects themselves during conflict resolution. That said, to resolve conflicts in "PersistentList", you must give "PersistentList" a "_p_resolveConflict". Your conflict resolution is one level too high (above "PersistentList"). -- Dieter _______________________________________________ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@xxxxxxxx http://mail.zope.org/mailman/listinfo/zodb-dev |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: conflict resolution for PersistentList: 00103, Chris McDonough |
|---|---|
| Next by Date: | Re: Hundreds of Prescription-Free Drugs available Online. No Prescriptions Needed.: 00103, Debbie Waller |
| Previous by Thread: | RE: conflict resolution for PersistentListi: 00103, Tim Peters |
| Next by Thread: | Re: conflict resolution for PersistentList: 00103, Jeremy Hylton |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |