diff --git a/typology/README.txt b/typology/README.txt index 386233f..dc855fe 100644 --- a/typology/README.txt +++ b/typology/README.txt @@ -59,6 +59,19 @@ We can now look what the type is telling us about the persons: >>> carla_type.token 'contact.person.agegroup.child' + >>> carla_type.tokenForSearch + 'contact.person.agegroup.child' + >>> carla_type.qualifiers is None + True + >>> carla_type.typeInterface is None + True + >>> carla_type.factory is None + True + >>> carla_type.defaultContainer is None + True + >>> carla_type.typeProvider is None + True + In this case (and probably a lot of others) types are considered equal if they have the same token: diff --git a/typology/interfaces.py b/typology/interfaces.py index f3897ec..c019aa9 100644 --- a/typology/interfaces.py +++ b/typology/interfaces.py @@ -26,6 +26,7 @@ from zope.app.container.interfaces import IContainer from zope import schema from zope.configuration.fields import GlobalObject from zope.interface import Interface, Attribute +from zope.interface.interfaces import IInterface class IType(Interface): @@ -49,11 +50,14 @@ class IType(Interface): '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') - factory = GlobalObject(title=u'Factory', - description=u'A factory (or class) that may be used for ' + typeInterface = schema.Object(IInterface, + title=u'Interface to Provide', + description=u'An (optional) interface that objects of this ' + 'type can be adapted to and that provides ' + 'additional functionality, schema fields, etc') + factory = schema.Object(Interface, + title=u'Factory', + description=u'A factory (or class) that can be used for ' 'creating an object of this type') defaultContainer = schema.Object(IContainer, title=u'Default Container', diff --git a/typology/type.py b/typology/type.py index 43fc49c..fe4896f 100644 --- a/typology/type.py +++ b/typology/type.py @@ -46,7 +46,7 @@ class BaseType(object): def tokenForSearch(self): return self.token qualifiers = None - interfaceToProvide = None + typeInterface = None factory = None defaultContainer = None typeProvider = None