I have a schema, let's call it B. It contains an @invariant function. I observed that it is not being called during form validation.

After help from Philipp and some investigation, I determined that the problem is that schema B isn't itself the main form, but is nested within schema A as the value_type of a Tuple field. When schema A is validated, schema B's invariant is not checked. I think this may be a bug. If someone more knowledgeable will confirm, then I will open a bug report.


In the mean time, I need a workaround that verifies that the invariants on all instances of schema B in the Tuple on schema A hold during form validation. My nascent idea is to put an invariant on schema A that checks all the invariants on all schema B instances. However, I am not familiar enough with formlib internals to code this up without significant research. Can someone help me out with an implementation for this workaround or an idea for a different, better workaround?

Thanks,

Derek

_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to