Change on IType interface: now has an attribute typeInterface (instead of interfaceToProvide)

git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@1129 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2006-03-19 09:46:08 +00:00
parent e6c94efa08
commit 423d0bc11a
3 changed files with 23 additions and 6 deletions

View file

@ -59,6 +59,19 @@ We can now look what the type is telling us about the persons:
>>> carla_type.token >>> carla_type.token
'contact.person.agegroup.child' '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 In this case (and probably a lot of others) types are considered equal
if they have the same token: if they have the same token:

View file

@ -26,6 +26,7 @@ from zope.app.container.interfaces import IContainer
from zope import schema from zope import schema
from zope.configuration.fields import GlobalObject from zope.configuration.fields import GlobalObject
from zope.interface import Interface, Attribute from zope.interface import Interface, Attribute
from zope.interface.interfaces import IInterface
class IType(Interface): class IType(Interface):
@ -49,11 +50,14 @@ class IType(Interface):
'types, e.g. for selecting with ' 'types, e.g. for selecting with '
'ITypeManager.listTypes()', 'ITypeManager.listTypes()',
value_type=schema.ASCIILine()) value_type=schema.ASCIILine())
interfaceToProvide = GlobalObject(title=u'Interface to Provide', typeInterface = schema.Object(IInterface,
description=u'An (optional) interface (or schema) that ' title=u'Interface to Provide',
'objects of this type will provide') description=u'An (optional) interface that objects of this '
factory = GlobalObject(title=u'Factory', 'type can be adapted to and that provides '
description=u'A factory (or class) that may be used for ' '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') 'creating an object of this type')
defaultContainer = schema.Object(IContainer, defaultContainer = schema.Object(IContainer,
title=u'Default Container', title=u'Default Container',

View file

@ -46,7 +46,7 @@ class BaseType(object):
def tokenForSearch(self): return self.token def tokenForSearch(self): return self.token
qualifiers = None qualifiers = None
interfaceToProvide = None typeInterface = None
factory = None factory = None
defaultContainer = None defaultContainer = None
typeProvider = None typeProvider = None