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
5381317f
Kaydet (Commit)
5381317f
authored
Eyl 25, 2013
tarafından
tschilling
Kaydeden (comit)
Tim Graham
Eki 02, 2013
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #21129 -- Prevented admin filter params modifications from throwing an exception.
Thanks Tuttle for the report.
üst
651bed09
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
options.py
django/contrib/admin/options.py
+4
-0
tests.py
tests/modeladmin/tests.py
+12
-0
No files found.
django/contrib/admin/options.py
Dosyayı görüntüle @
5381317f
...
...
@@ -348,6 +348,10 @@ class BaseModelAdmin(six.with_metaclass(RenameBaseModelAdminMethods)):
# later.
return
True
if
hasattr
(
field
,
'rel'
):
if
field
.
rel
is
None
:
# This property or relation doesn't exist, but it's allowed
# since it's ignored in ChangeList.get_filters().
return
True
model
=
field
.
rel
.
to
rel_name
=
field
.
rel
.
get_related_field
()
.
name
elif
isinstance
(
field
,
RelatedObject
):
...
...
tests/modeladmin/tests.py
Dosyayı görüntüle @
5381317f
...
...
@@ -95,6 +95,18 @@ class ModelAdminTests(TestCase):
form
=
ma
.
get_formset
(
None
)
.
form
self
.
assertEqual
(
form
.
_meta
.
fields
,
[
'day'
,
'transport'
])
def
test_lookup_allowed_allows_nonexistent_lookup
(
self
):
"""
Ensure that a lookup_allowed allows a parameter
whose field lookup doesn't exist.
Refs #21129.
"""
class
BandAdmin
(
ModelAdmin
):
fields
=
[
'name'
]
ma
=
BandAdmin
(
Band
,
self
.
site
)
self
.
assertTrue
(
ma
.
lookup_allowed
(
'name__nonexistent'
,
'test_value'
))
def
test_field_arguments
(
self
):
# If we specify the fields argument, fieldsets_add and fielsets_change should
# just stick the fields into a formsets structure and return it.
...
...
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