--- a/src/pyams_utils/schema.py Wed May 20 12:39:05 2015 +0200
+++ b/src/pyams_utils/schema.py Wed May 20 12:39:38 2015 +0200
@@ -17,11 +17,13 @@
import string
# import interfaces
-from zope.schema.interfaces import ITextLine, IDecimal, IList, ITuple, IPassword
+from zope.schema.interfaces import ITextLine, IDecimal, IList, IDict, ITuple, IPassword
# import Zope3 packages
+from persistent.list import PersistentList as PersistentListType
+from persistent.mapping import PersistentMapping
from zope.interface import implementer
-from zope.schema import TextLine, Decimal, List, Tuple, Password, ValidationError
+from zope.schema import TextLine, Decimal, List, Dict, Tuple, Password, ValidationError
# import local packages
@@ -29,6 +31,36 @@
#
+# Persistent list field
+#
+
+class IPersistentList(IList):
+ """Persistent list field marker interface"""
+
+
+@implementer(IPersistentList)
+class PersistentList(List):
+ """Persistent list field"""
+
+ _type = PersistentListType
+
+
+#
+# Persistent mapping field
+#
+
+class IPersistentDict(IDict):
+ """Persistent mapping field marker interface"""
+
+
+@implementer(IPersistentDict)
+class PersistentDict(Dict):
+ """Persistent mapping field"""
+
+ _type = PersistentMapping
+
+
+#
# Encoded password field
#