Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
7a44dc55
Kaydet (Commit)
7a44dc55
authored
Eki 04, 2012
tarafından
Ludovic Delaveau
Kaydeden (comit)
Luke Plant
Eki 13, 2012
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #16479 - Forms generated from formsets use ErrorList instead of supplied error_class
Patch with tests from charettes, updated.
üst
cc83a4af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
formsets.py
django/forms/formsets.py
+5
-1
formsets.py
tests/regressiontests/forms/tests/formsets.py
+10
-0
No files found.
django/forms/formsets.py
Dosyayı görüntüle @
7a44dc55
...
...
@@ -123,7 +123,11 @@ class BaseFormSet(object):
"""
Instantiates and returns the i-th form instance in a formset.
"""
defaults
=
{
'auto_id'
:
self
.
auto_id
,
'prefix'
:
self
.
add_prefix
(
i
)}
defaults
=
{
'auto_id'
:
self
.
auto_id
,
'prefix'
:
self
.
add_prefix
(
i
),
'error_class'
:
self
.
error_class
,
}
if
self
.
is_bound
:
defaults
[
'data'
]
=
self
.
data
defaults
[
'files'
]
=
self
.
files
...
...
tests/regressiontests/forms/tests/formsets.py
Dosyayı görüntüle @
7a44dc55
...
...
@@ -3,6 +3,7 @@ from __future__ import unicode_literals
from
django.forms
import
Form
,
CharField
,
IntegerField
,
ValidationError
,
DateField
from
django.forms.formsets
import
formset_factory
,
BaseFormSet
from
django.forms.util
import
ErrorList
from
django.test
import
TestCase
...
...
@@ -847,6 +848,15 @@ class FormsFormsetTestCase(TestCase):
self
.
assertTrue
(
formset
)
def
test_formset_error_class
(
self
):
# Regression tests for #16479 -- formsets form use ErrorList instead of supplied error_class
class
CustomErrorList
(
ErrorList
):
pass
formset
=
FavoriteDrinksFormSet
(
error_class
=
CustomErrorList
)
self
.
assertEqual
(
formset
.
forms
[
0
]
.
error_class
,
CustomErrorList
)
data
=
{
'choices-TOTAL_FORMS'
:
'1'
,
# the number of forms rendered
'choices-INITIAL_FORMS'
:
'0'
,
# the number of forms with initial data
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment