Hello all,

I am sorry my the gap in my reports, it kind of slipped my mind.

Currently we are in a stage where we keep moving more validation logic
into the new validator functions adding more functionality where
needed - the last example being the ability to override validator's
error messages by those defined on the field.

I am also adding more validation to existing DB fields (CharField
validating for max_length, email field validates email etc.).

I have yet to implement message overriding on models (maybe extracting
the methods from forms to some abstract superclass of both Model and
Form), add more validation and tests.

The last thing I haven't even begun to work on is documentation.

If you want to see where things are moving, check the EmailField, both
DB and Form:
 - validation is done through a validator on both fields
 - models.EmailField.formfield() returns a simple CharField with no
information on how to validate email to avoid double validation

All tests pass and I am slowly reaching the point where the branch
will need some testing in real life applications to catch all the
corner cases.



validators
=======

There are two kind of validators - simple and complex.

- simple validator is any callable that takes one argument and can
raise ValidationError. It should pass code and params arguments to
ValidationError so that the field can use that information to
translate the error message. Simple validators are called when field's
.validate() method pass and all errors from validators are aggregated
(so if you have two validators on a field and both fail you get two
error messages).

- complex validators are instances of any ComplexValidator subclass.
they are designed to do simple cross field validation like
RequiredIfOtherFieldNotBlank etc. They are run on  form or model level
when the field passes it's own .clean(). Again all the errors from
validators are aggregated for the field.





Honza Král
E-Mail: honza.k...@gmail.com
Phone:  +420 606 678585

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to