--- a/src/pyams_sequence/schema.py Tue May 16 11:20:42 2017 +0200
+++ b/src/pyams_sequence/schema.py Tue May 16 11:21:09 2017 +0200
@@ -16,17 +16,17 @@
# import standard library
# import interfaces
-from zope.schema.interfaces import ITextLine
+from zope.schema.interfaces import ITextLine, IList
# import packages
from zope.interface import implementer, Attribute
-from zope.schema import TextLine
+from zope.schema import TextLine, List
class IInternalReference(ITextLine):
"""Internal reference field interface"""
- content_type = Attribute("Requested content type")
+ content_type = Attribute("Requested target content type")
@implementer(IInternalReference)
@@ -36,3 +36,20 @@
def __init__(self, content_type=None, *args, **kwargs):
super(InternalReference, self).__init__(*args, **kwargs)
self.content_type = content_type
+
+
+class IInternalReferencesList(IList):
+ """Internal references list field interface"""
+
+ content_type = Attribute("Requested target content type")
+
+
+@implementer(IInternalReferencesList)
+class InternalReferencesList(List):
+ """Internal references list field"""
+
+ def __init__(self, content_type=None, value_type=None, unique=False, *args, **kwargs):
+ super(InternalReferencesList, self).__init__(value_type=TextLine(),
+ unique=True,
+ *args, **kwargs)
+ self.content_type = content_type