[Zope3-dev] Re: Add function for schema validation in zope.schema

Christian Theune ct at gocept.com
Mon Aug 20 10:15:40 EDT 2007


Am Montag, den 20.08.2007, 16:05 +0200 schrieb Philipp von
Weitershausen:
> This is exactly what I would suggest: The function should return a list 
> of validation errors. Similar semantics are used in zope.formlib's 
> validate() method. I agree with Wichert's objection about being a bit 
> confusing, though. Perhaps a better name than "validateSchema" could 
> solve this problem, though I can't think of a good one right now... 
> getValidationErrors() seems to naive...
> 
> Having access to the original ValidationError exceptions (incl. the 
> field name that they were thrown for) is probably all the information 
> you're ever going to want (and get).

Right. The validation error objects are probably enough as they have
enough context to retrieve the field or invariant for which they apply.



More information about the Zope3-dev mailing list