El 7 Jul 2008, a las 09:20 , Tim Cook escribió:
On Mon, 2008-07-07 at 00:46 +0200, Philipp von Weitershausen wrote:
So the zope.schema.Object field is really about specifying objects
provide a certain schema. It's not for *arbitrary* objects (use
zope.schema.Field or zope.interface.Attribute here).
Field doesn't work because it expects a unicode type.
I think you'll find that that's wrong. Field describes a generic
attribute, much like z.i.Attribute.
Attribute works but I would like to be able to flag it as 'required'
which is not part of the Attribute class.
Right. Use Field for that :).
Object would work if it would allow types that subclass from the
A concrete example:
Now I want to allow description to be any descendant of ItemStructure.
So I had hoped that:
description=_(u"Description of the activity."),
would provide that functionality. It still throws a WrongTypeError.
The declaration looks ok. What throws a WrongTypeError where?
I feel like the answer lies somewhere in the zope.interface.implement*
functions but I lack the Zen to get the right combination.
It's hard to tell w/o knowing what actually throws the exception.
Zope3-users mailing list