interfaces.py
2008-01-11 19:12...
"""Note interfaces
$Id: interfaces.py 13478 2007-12-03 14:56:07Z cray $
"""
from zope.interface import Interface
from zope.schema import Field
from zope.app.container.constraints import ContainerTypesConstraint
from zope.app.container.constraints import ItemTypePrecondition
from zope.app.container.interfaces import IContained, IContainer
class ICommonContainer(Interface) :
""" Interface that specify then it can be container of some
project component """
class INotebookContent(Interface) :
""" Interface that specify permission of object that can be content
of notebook """
__parent__ = Field(
constraint = ContainerTypesConstraint(ICommonContainer))
class INotebookContainer(IContainer,ICommonContainer) :
""" Article Container """
def __setitem__(name, object) :
""" Add IArticle Content """
__setitem__.precondition = ItemTypePrecondition(INotebookContent)



