On Aug 20, 2007, at 7:48 AM, Christian Zagrodnick wrote:


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.


I remember discussing this a year or more ago.  I don't remember where.

I'd like to see this fit into the zope.interface.verify "framework". I'd like to see the verify module refactored to be pluggable and I'd like to see schema versification plug into this. This would *also* motivate (or at least enable) people to do better method verification and possibly provide other kinds of verification.


Jim Fulton                      mailto:[EMAIL PROTECTED]                Python 
CTO                             (540) 361-1714                  
Zope Corporation        http://www.zope.com             http://www.zope.org

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

Reply via email to