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

Christian Zagrodnick cz at gocept.com
Mon Aug 20 07:48:02 EDT 2007


Hi,

zope.schema defines how a schema can be validated, defines errors and 
provides a way to validate single fields.

I think we should add a function to validate a given schema on a given 
class. This should include constraints and invariants:

validateSchema(IMySchema, myobject)  [or alike]

I'm not sure about return values or exceptions. There are different use cases:

1. Is the object valid? -> True/False
2. What's wrong with the object -> {attribute/field-name: what's 
wrong}, what's wrong with invariants.

Comments?
-- 
Christian Zagrodnick

gocept gmbh & co. kg  ·  forsterstrasse 29 · 06112 halle/saale
www.gocept.com · fon. +49 345 12298894 · fax. +49 345 12298891





More information about the Zope3-dev mailing list