zope.schema does not handle well nested object fields
Bug #969350 reported by
Alex Garel
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zope.schema |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
using trunk version of zope.schema, if I use an Object field whose schema has a Set (or any Collection) of Choice, it fails validating.
This is due to a bad (inexisting) handling of bind in Object field.
svn commit 112445 [1] solve the bug for the case a a Choice inside an Object, but not in the case of a Choice inside a Set inside an Object.
[1] http://
To post a comment you must log in.
I propose a solution which handles binding not only validation.
There is a difference with previous code : it does not bind inner Choice to Object value but to Object context.
I prefer this solution since binding to value maybe problematic in a lot a cases, eg. when vocabularies depends on object situation in the object tree whereas most of the time, at creation, Object value is not yet tied to any context.
Here is a patch.