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.

Christian Zagrodnick

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

Zope3-dev mailing list
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to