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
221e6e18
Kaydet (Commit)
221e6e18
authored
Haz 15, 2017
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #28176 -- Restored the uncasted option value in ChoiceWidget template context.
üst
dc63ad7a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
3 deletions
+16
-3
input.html
django/forms/templates/django/forms/widgets/input.html
+1
-1
select_option.html
...o/forms/templates/django/forms/widgets/select_option.html
+1
-1
widgets.py
django/forms/widgets.py
+1
-1
1.11.3.txt
docs/releases/1.11.3.txt
+7
-0
test_select.py
tests/forms_tests/widget_tests/test_select.py
+6
-0
No files found.
django/forms/templates/django/forms/widgets/input.html
Dosyayı görüntüle @
221e6e18
<input
type=
"{{ widget.type }}"
name=
"{{ widget.name }}"
{%
if
widget
.
value
!=
None
%}
value=
"{{ widget.value }}"
{%
endif
%}{%
include
"
django
/
forms
/
widgets
/
attrs
.
html
"
%}
/>
<input
type=
"{{ widget.type }}"
name=
"{{ widget.name }}"
{%
if
widget
.
value
!=
None
%}
value=
"{{ widget.value
|stringformat:'s'
}}"
{%
endif
%}{%
include
"
django
/
forms
/
widgets
/
attrs
.
html
"
%}
/>
django/forms/templates/django/forms/widgets/select_option.html
Dosyayı görüntüle @
221e6e18
<option
value=
"{{ widget.value }}"
{%
include
"
django
/
forms
/
widgets
/
attrs
.
html
"
%}
>
{{ widget.label }}
</option>
<option
value=
"{{ widget.value
|stringformat:'s'
}}"
{%
include
"
django
/
forms
/
widgets
/
attrs
.
html
"
%}
>
{{ widget.label }}
</option>
django/forms/widgets.py
Dosyayı görüntüle @
221e6e18
...
@@ -591,7 +591,7 @@ class ChoiceWidget(Widget):
...
@@ -591,7 +591,7 @@ class ChoiceWidget(Widget):
option_attrs
[
'id'
]
=
self
.
id_for_label
(
option_attrs
[
'id'
],
index
)
option_attrs
[
'id'
]
=
self
.
id_for_label
(
option_attrs
[
'id'
],
index
)
return
{
return
{
'name'
:
name
,
'name'
:
name
,
'value'
:
str
(
value
)
,
'value'
:
value
,
'label'
:
label
,
'label'
:
label
,
'selected'
:
selected
,
'selected'
:
selected
,
'index'
:
index
,
'index'
:
index
,
...
...
docs/releases/1.11.3.txt
Dosyayı görüntüle @
221e6e18
...
@@ -44,3 +44,10 @@ Bugfixes
...
@@ -44,3 +44,10 @@ Bugfixes
* Prevented attribute values in the ``django/forms/widgets/attrs.html``
* Prevented attribute values in the ``django/forms/widgets/attrs.html``
template from being localized so that numeric attributes (e.g. ``max`` and
template from being localized so that numeric attributes (e.g. ``max`` and
``min``) of ``NumberInput`` work correctly (:ticket:`28303`).
``min``) of ``NumberInput`` work correctly (:ticket:`28303`).
* Removed casting of the option value to a string in the template context of
the ``CheckboxSelectMultiple``, ``NullBooleanSelect``, ``RadioSelect``,
``SelectMultiple``, and ``Select`` widgets (:ticket:`28176`). In Django
1.11.1, casting was added in Python to avoid localization of numeric values
in Django templates, but this made some use cases more difficult. Casting is
now done in the template using the ``|stringformat:'s'`` filter.
tests/forms_tests/widget_tests/test_select.py
Dosyayı görüntüle @
221e6e18
...
@@ -348,6 +348,12 @@ class SelectTest(WidgetTest):
...
@@ -348,6 +348,12 @@ class SelectTest(WidgetTest):
)
)
self
.
assertEqual
(
index
,
2
)
self
.
assertEqual
(
index
,
2
)
def
test_optgroups_integer_choices
(
self
):
"""The option 'value' is the same type as what's in `choices`."""
groups
=
list
(
self
.
widget
(
choices
=
[[
0
,
'choice text'
]])
.
optgroups
(
'name'
,
[
'vhs'
]))
label
,
options
,
index
=
groups
[
0
]
self
.
assertEqual
(
options
[
0
][
'value'
],
0
)
def
test_deepcopy
(
self
):
def
test_deepcopy
(
self
):
"""
"""
__deepcopy__() should copy all attributes properly (#25085).
__deepcopy__() should copy all attributes properly (#25085).
...
...
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