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
a2f7433a
Kaydet (Commit)
a2f7433a
authored
Mar 15, 2018
tarafından
Artem Tabolin
Kaydeden (comit)
Tim Graham
Mar 15, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #29221 -- Corrected admin's autocomplete widget to add a space after custom classes.
üst
ba3078c9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
widgets.py
django/contrib/admin/widgets.py
+1
-1
2.0.4.txt
docs/releases/2.0.4.txt
+3
-0
test_autocomplete_widget.py
tests/admin_widgets/test_autocomplete_widget.py
+6
-1
No files found.
django/contrib/admin/widgets.py
Dosyayı görüntüle @
a2f7433a
...
...
@@ -413,7 +413,7 @@ class AutocompleteMixin:
'data-theme'
:
'admin-autocomplete'
,
'data-allow-clear'
:
json
.
dumps
(
not
self
.
is_required
),
'data-placeholder'
:
''
,
# Allows clearing of the input.
'class'
:
attrs
[
'class'
]
+
'admin-autocomplete'
,
'class'
:
attrs
[
'class'
]
+
(
' '
if
attrs
[
'class'
]
else
''
)
+
'admin-autocomplete'
,
})
return
attrs
...
...
docs/releases/2.0.4.txt
Dosyayı görüntüle @
a2f7433a
...
...
@@ -14,3 +14,6 @@ Bugfixes
* Fixed admin autocomplete widget's translations for `zh-hans` and `zh-hant`
languages (:ticket:`29213`).
* Corrected admin's autocomplete widget to add a space after custom classes
(:ticket:`29221`).
tests/admin_widgets/test_autocomplete_widget.py
Dosyayı görüntüle @
a2f7433a
...
...
@@ -50,7 +50,7 @@ class AutocompleteMixinTests(TestCase):
form
=
AlbumForm
()
attrs
=
form
[
'band'
]
.
field
.
widget
.
get_context
(
name
=
'my_field'
,
value
=
None
,
attrs
=
{})[
'widget'
][
'attrs'
]
self
.
assertEqual
(
attrs
,
{
'class'
:
'my-classadmin-autocomplete'
,
'class'
:
'my-class
admin-autocomplete'
,
'data-ajax--cache'
:
'true'
,
'data-ajax--type'
:
'GET'
,
'data-ajax--url'
:
'/admin_widgets/band/autocomplete/'
,
...
...
@@ -59,6 +59,11 @@ class AutocompleteMixinTests(TestCase):
'data-placeholder'
:
''
})
def
test_build_attrs_no_custom_class
(
self
):
form
=
AlbumForm
()
attrs
=
form
[
'featuring'
]
.
field
.
widget
.
get_context
(
name
=
'name'
,
value
=
None
,
attrs
=
{})[
'widget'
][
'attrs'
]
self
.
assertEqual
(
attrs
[
'class'
],
'admin-autocomplete'
)
def
test_build_attrs_not_required_field
(
self
):
form
=
NotRequiredBandForm
()
attrs
=
form
[
'band'
]
.
field
.
widget
.
build_attrs
({})
...
...
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