Fixed #8795: unique_together validation no longer fails on model forms that exclude fields included in the check. Thanks, Alex Gaynor.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8854 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2008-09-02 14:20:11 +00:00
parent 5c32fe7fad
commit 98e1cc92f4
2 changed files with 20 additions and 2 deletions

View file

@ -1192,6 +1192,14 @@ False
>>> form._errors
{'__all__': [u'Price with this Price and Quantity already exists.']}
>>> class PriceForm(ModelForm):
... class Meta:
... model = Price
... exclude = ('quantity',)
>>> form = PriceForm({'price': '6.00'})
>>> form.is_valid()
True
# Choices on CharField and IntegerField
>>> class ArticleForm(ModelForm):
... class Meta: