[Zope3-dev] Re: Add function for schema validation in zope.schema
Philipp von Weitershausen
philipp at weitershausen.de
Mon Aug 20 10:18:50 EDT 2007
On 20 Aug 2007, at 16:12 , Benji York wrote:
> Philipp von Weitershausen wrote:
>> 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...
>
> I feel myself slipping into a bikeshed, so this may be my last
> comment on this.
>
> I like "getValidationErrors". It's use would probably normally
> look something like this:
>
> errors = getValidationErrors(...)
> if errors:
> ...
>
> or:
>
> errors = getValidationErrors(...)
> if not errors:
> ...
>
> Both look good to me.
+1
More information about the Zope3-dev
mailing list