mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
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:
parent
5c32fe7fad
commit
98e1cc92f4
2 changed files with 20 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue