Class
zope.app.container.constraints.ContainerTypesConstraint

Constrain a container to be one of a number of types

>>> class I1(zope.interface.Interface):
...     pass
>>> class I2(zope.interface.Interface):
...     pass
>>> class Ob(object):
...     pass
>>> ob = Ob()
>>> constraint = ContainerTypesConstraint(I1, I2)
>>> try:
...     constraint(ob)
... except InvalidContainerType, v:
...     print (v[0] is ob), (v[1] == (I1, I2))
... else:
...     print 'Should have failed'
True True
>>> zope.interface.classImplements(Ob, I2)
>>> constraint(Ob())
True

Base classes

Implemented Interfaces

Attributes/Properties

There are no attributes in this class.

Methods

Known Subclasses

There are no known subclasses.