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

2007-08-20 Thread Stephan Richter
On Monday 20 August 2007 10:55, Jim Fulton wrote: > 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)

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

2007-08-20 Thread Jim Fulton
On Aug 20, 2007, at 7:48 AM, Christian Zagrodnick wrote: 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 i

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

2007-08-20 Thread Benji York
Wichert Akkerman wrote: That would be confusing though: I would expect the result of a method that checks validaty to return something that evaluates to True if everything is valid. Code like this just messes up my brain: if not zope.schema.validate(obj, IMySchema): print "Everything

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

2007-08-20 Thread Wichert Akkerman
Previously Christian Theune wrote: > Hi, > > Am Montag, den 20.08.2007, 08:59 -0400 schrieb Fred Drake: > > On 8/20/07, Christian Zagrodnick <[EMAIL PROTECTED]> wrote: > > > I think we should add a function to validate a given schema on a given > > > class. This should include constraints and inva

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

2007-08-20 Thread Benji York
Christian Theune wrote: From my latest experience and research of when to use exceptions and when to use return values I'd say let's not use an exception. +1 -- Benji York Senior Software Engineer Zope Corporation ___ Zope3-dev mailing list Zope3-dev@

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

2007-08-20 Thread Christian Theune
Hi, Am Montag, den 20.08.2007, 08:59 -0400 schrieb Fred Drake: > On 8/20/07, Christian Zagrodnick <[EMAIL PROTECTED]> wrote: > > I think we should add a function to validate a given schema on a given > > class. This should include constraints and invariants: > > I do presume you mean object, rath

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

2007-08-20 Thread Fred Drake
On 8/20/07, Christian Zagrodnick <[EMAIL PROTECTED]> wrote: > I think we should add a function to validate a given schema on a given > class. This should include constraints and invariants: I do presume you mean object, rather than class, as your example implies. > validateSchema(IMySchema, myobj

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

2007-08-20 Thread Christian Zagrodnick
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]