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:
parent
96e22b4b10
commit
d8aac7ee60
2 changed files with 11 additions and 0 deletions
|
@ -44,6 +44,11 @@ class IType(Interface):
|
||||||
tokenForSearch = schema.ASCIILine(title=u'Token for Search',
|
tokenForSearch = schema.ASCIILine(title=u'Token for Search',
|
||||||
description=u'A fairly unique token that may be used '
|
description=u'A fairly unique token that may be used '
|
||||||
'e.g. for identifying types via a catalog index')
|
'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',
|
interfaceToProvide = GlobalObject(title=u'Interface to Provide',
|
||||||
description=u'An (optional) interface (or schema) that '
|
description=u'An (optional) interface (or schema) that '
|
||||||
'objects of this type will provide')
|
'objects of this type will provide')
|
||||||
|
@ -78,6 +83,11 @@ class ITypeManager(Interface):
|
||||||
def listTypes(**criteria):
|
def listTypes(**criteria):
|
||||||
""" Return a sequence of type objects probably restricted via
|
""" Return a sequence of type objects probably restricted via
|
||||||
a set of query criteria.
|
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):
|
def getType(token):
|
||||||
|
|
|
@ -45,6 +45,7 @@ class BaseType(object):
|
||||||
@property
|
@property
|
||||||
def tokenForSearch(self): return self.token
|
def tokenForSearch(self): return self.token
|
||||||
|
|
||||||
|
qualifiers = None
|
||||||
interfaceToProvide = None
|
interfaceToProvide = None
|
||||||
factory = None
|
factory = None
|
||||||
defaultContainer = None
|
defaultContainer = None
|
||||||
|
|
Loading…
Add table
Reference in a new issue