[Zope3-dev] Recursive containment constraints
Dominik Huber
dominik.huber at projekt01.ch
Wed Sep 15 15:44:19 EDT 2004
Thanks Stephan, but I have to bother you with another lack of
understanding...
> No, it should still work. I did not change to another pattern
> for technical
> reasons.
Maybe I'm missing something. I thought declaring an attribute within
the interface declaration and extending an existing interface using
setTaggedValue respectively, should be equivalent.
So when I do the following examples I get different
results::
Example 1: setTaggedValue way
>>> class IFoo(Interface):
... pass
...
>>> IFoo.setTaggedValue('__parent__',
Field(constraint=ContainerTypesConstraint(IBar)))
>>> IFoo.names()
[]
Example 2: regular way
>>> class IFoo(Interface):
... __parent__ = Field(constraint=ContainerTypesConstraint(IBar))
...
>>> IFoo.names()
['__parent__']
What is exactly the difference between those versions?
Regards,
Dominik Huber
More information about the Zope3-dev
mailing list