[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/component - interfacefield.py:1.3
Steve Alexander
steve@cat-box.net
Mon, 30 Dec 2002 13:43:38 -0500
Update of /cvs-repository/Zope3/src/zope/app/interfaces/component
In directory cvs.zope.org:/tmp/cvs-serv29407/src/zope/app/interfaces/component
Modified Files:
interfacefield.py
Log Message:
Implemented InterfacesField to select several interfaces.
Refined the query interfaces.
=== Zope3/src/zope/app/interfaces/component/interfacefield.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/interfaces/component/interfacefield.py:1.2 Wed Dec 25 09:12:58 2002
+++ Zope3/src/zope/app/interfaces/component/interfacefield.py Mon Dec 30 13:43:07 2002
@@ -17,14 +17,22 @@
"""
from zope.schema import Field
-from zope.schema.interfaces import IValueSet
+from zope.schema.interfaces import IValueSet, ITuple
from zope.interface import Interface
class IInterfaceField(IValueSet):
- u"""Fields with Interfaces as values
- """
+ u"""A type of Field that has an Interfaces as its value."""
type = Field(title=u"Base type",
description=u"All values must extend (or be) this type",
default=Interface,
)
+
+class IInterfacesField(ITuple):
+ u"""A type of Field that is has a tuple of Interfaces as its value."""
+
+ value_types = Field(
+ title=u"Base type",
+ description=u"All values must extend or be these types",
+ default=(Interface,),
+ )