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



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

Reply via email to