IType: add 'qualifiers' attribute

git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@1122 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2006-03-13 09:43:39 +00:00
parent 96e22b4b10
commit d8aac7ee60
2 changed files with 11 additions and 0 deletions

View file

@ -44,6 +44,11 @@ class IType(Interface):
tokenForSearch = schema.ASCIILine(title=u'Token for Search',
description=u'A fairly unique token that may be used '
'e.g. for identifying types via a catalog index')
qualifiers = schema.List(title=u'Qualifiers',
description=u'A set of markers for a simple classifcation of '
'types, e.g. for selecting with '
'ITypeManager.listTypes()',
value_type=schema.ASCIILine())
interfaceToProvide = GlobalObject(title=u'Interface to Provide',
description=u'An (optional) interface (or schema) that '
'objects of this type will provide')
@ -78,6 +83,11 @@ class ITypeManager(Interface):
def listTypes(**criteria):
""" Return a sequence of type objects probably restricted via
a set of query criteria.
A simple implementation would use keyword arguments like:
listTypes(include=('concept',), omit=('system',) where 'concept'
and 'system' would be elements in the qualifiers attributes
of the types.
"""
def getType(token):

View file

@ -45,6 +45,7 @@ class BaseType(object):
@property
def tokenForSearch(self): return self.token
qualifiers = None
interfaceToProvide = None
factory = None
defaultContainer = None