On Sat, Sep 26, 2009 at 10:41 AM, Robb Bossley <robb.boss...@gmail.com>wrote:

> Thanks again, Karen - you rock!
>
> Does it automagically do this, or do I need to enter a rule (in views,
> perhaps) to check it during validation?  I mean, I now have "if
> form.is_valid" (though I don't recall if I had that originally).
>
>
It's done when you call is_valid().  You do need to include all the fields
you want to be unique together on the form (the form can't check uniqueness
of the full set if it only has a partial set of values), and if you have
provided your own clean() override for the form you need to ensure that the
superclass clean() is is called, since that is where the uniqueness check is
done.  See:

http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#overriding-the-clean-method

Karen

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

Reply via email to