Source code for sheraf.types

"""Types are used to define the internal storage in ZODB.

There are no need to setup specific types in basic usage of sheraf
because `Model` uses `xAttribute`, not `Type`.
import BTrees.OOBTree
import persistent

from .largedict import LargeDict
from .largelist import LargeList

assert LargeDict
assert LargeList

SmallList = persistent.list.PersistentList
List = SmallList
Set = BTrees.OOBTree.OOTreeSet

[docs]class SmallDict(persistent.mapping.PersistentMapping): """SmallDict is a :class:`PersistentMapping` implementation with a simple conflict resolution implementation. When two different keys of the mapping are edited in concurrency, no conflict is raised. """ def _p_resolveConflict(self, old, saved, commited): import ZODB try: return, saved, commited) except raise ZODB.POSException.ConflictError()