mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user