[Zope3-Users] IField in Object(Field): RequiredMissing

Daniel Nouri daniel.nouri at gmail.com
Mon Mar 13 04:36:47 EST 2006


Not sure I'm using the Object field right, but this seems odd:

        >>> from zope.schema import Field, Object
        >>> from zope.schema.interfaces import IField
        >>> field = Object(IField)
        >>> field.validate(Field())
        Traceback (most recent call last):
          File "<stdin>", line 1, in ?
          File
        "/home/daniel/lib/Zope-3.2.0/lib/python/zope/schema/_bootstrapfields.py", line 138, in validate
            self._validate(value)
          File
        "/home/daniel/lib/Zope-3.2.0/lib/python/zope/schema/_field.py",
        line 418, in _validate
            raise WrongContainedType(errors)
        zope.schema.interfaces.WrongContainedType: [, ]
        
The error message is not really helpful.  Turns out that the given error
is a RequiredMissing error and it's missing the value of 'default' on
the field.

Am I doing something wrong or is the Object field not behaving as it
should?

-- 
Daniel Nouri <daniel.nouri at gmail.com>




More information about the Zope3-users mailing list