#5736: unique fields won't be validated by .is_valid() in NewForms
form_for_models
----------------------------------------+-----------------------------------
Reporter: [EMAIL PROTECTED] | Owner: nobody
Status: new | Component: django.newforms
Version: SVN | Keywords: unique is_valid()
Stage: Unreviewed | Has_patch: 0
----------------------------------------+-----------------------------------
I have some unique-Fields in my models.py. I use form_for_models and
form_for_instance to build my forms to populate my DB. For validation I
use .is_valid():
Example:
{{{
if request.method == 'POST':
f = ServerForm(request.POST)
if f.is_valid():
saveobject = f.save()
}}}
If I test this by trying to add a duplicate entry, I get a "duplicate key
violates unique constraint" instead of the expected error-message in my
forms as for the other validation.
If you need some files, traceback please mail me.
regards
--
Ticket URL: <http://code.djangoproject.com/ticket/5736>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---