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:
parent
e6c94efa08
commit
423d0bc11a
3 changed files with 23 additions and 6 deletions
|
@ -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:
|
||||
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue