From d8aac7ee604f29ae10ffdba0b8921e0652a8c856 Mon Sep 17 00:00:00 2001 From: helmutm Date: Mon, 13 Mar 2006 09:43:39 +0000 Subject: [PATCH] IType: add 'qualifiers' attribute git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@1122 fd906abe-77d9-0310-91a1-e0d9ade77398 --- typology/interfaces.py | 10 ++++++++++ typology/type.py | 1 + 2 files changed, 11 insertions(+) diff --git a/typology/interfaces.py b/typology/interfaces.py index 564deb0..f3897ec 100644 --- a/typology/interfaces.py +++ b/typology/interfaces.py @@ -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): diff --git a/typology/type.py b/typology/type.py index 3f5da51..43fc49c 100644 --- a/typology/type.py +++ b/typology/type.py @@ -45,6 +45,7 @@ class BaseType(object): @property def tokenForSearch(self): return self.token + qualifiers = None interfaceToProvide = None factory = None defaultContainer = None