Hi all,

is anybody working on Model aware validation for newforms admin ? I
found some rumors and gossip, but no concrete information.

I have a few ideas and currently need this feature, so I would like to
work on it, or join forces with someone.

Few steps I (probably) would take:

1. decouple ValidationError from forms (perhaps to core.exceptions)
and have forms.ValidationError and models.ValidationError inherit it

2. define a validate method on Model, it would simply raise
models.ValidationError. Its default implementation would check for
unique constraints, unique_together (there would probably be a
parameter whether to go into database for the check)

3. check all this in form generated by form_for_(model|instance)

4. check unique and unique_together in InlineFormset accross created
models (using #5353)

5. via DB Field subclassing allow to specify clean() or validate()
method on individual fields and propagate this to the appropriate form
field validations


thanks for any answers/ideas you may have

-- 
Honza Král
E-Mail: [EMAIL PROTECTED]
ICQ#:   107471613
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to