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
cb844497
Kaydet (Commit)
cb844497
authored
Şub 20, 2014
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #22097 -- Fixed change detection for TypedChoiceField
Thanks Igor Mitrenko for the report.
üst
821fc925
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
fields.py
django/forms/fields.py
+2
-0
test_fields.py
tests/forms_tests/tests/test_fields.py
+1
-0
No files found.
django/forms/fields.py
Dosyayı görüntüle @
cb844497
...
@@ -191,6 +191,8 @@ class Field(object):
...
@@ -191,6 +191,8 @@ class Field(object):
initial_value
=
initial
if
initial
is
not
None
else
''
initial_value
=
initial
if
initial
is
not
None
else
''
try
:
try
:
data
=
self
.
to_python
(
data
)
data
=
self
.
to_python
(
data
)
if
hasattr
(
self
,
'_coerce'
):
data
=
self
.
_coerce
(
data
)
except
ValidationError
:
except
ValidationError
:
return
True
return
True
data_value
=
data
if
data
is
not
None
else
''
data_value
=
data
if
data
is
not
None
else
''
...
...
tests/forms_tests/tests/test_fields.py
Dosyayı görüntüle @
cb844497
...
@@ -961,6 +961,7 @@ class FieldsTests(SimpleTestCase):
...
@@ -961,6 +961,7 @@ class FieldsTests(SimpleTestCase):
# has_changed should not trigger required validation
# has_changed should not trigger required validation
f
=
TypedChoiceField
(
choices
=
[(
1
,
"+1"
),
(
-
1
,
"-1"
)],
coerce
=
int
,
required
=
True
)
f
=
TypedChoiceField
(
choices
=
[(
1
,
"+1"
),
(
-
1
,
"-1"
)],
coerce
=
int
,
required
=
True
)
self
.
assertFalse
(
f
.
_has_changed
(
None
,
''
))
self
.
assertFalse
(
f
.
_has_changed
(
None
,
''
))
self
.
assertFalse
(
f
.
_has_changed
(
1
,
'1'
))
def
test_typedchoicefield_special_coerce
(
self
):
def
test_typedchoicefield_special_coerce
(
self
):
"""
"""
...
...
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