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
30a389bd
Kaydet (Commit)
30a389bd
authored
Ara 13, 2017
tarafından
Rodrigo Pinheiro Marques de Araújo
Kaydeden (comit)
Tim Graham
Ara 13, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #28898 -- Corrected admin check to allow a OneToOneField in ModelAdmin.autocomplete_fields.
üst
f9a0766f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
2 deletions
+19
-2
AUTHORS
AUTHORS
+1
-0
checks.py
django/contrib/admin/checks.py
+1
-1
2.0.1.txt
docs/releases/2.0.1.txt
+3
-0
test_checks.py
tests/modeladmin/test_checks.py
+14
-1
No files found.
AUTHORS
Dosyayı görüntüle @
30a389bd
...
...
@@ -689,6 +689,7 @@ answer newbie questions, and generally made Django that much better:
Robert Wittams
Rob Hudson <http://rob.cogit8.org/>
Robin Munn <http://www.geekforgod.com/>
Rodrigo Pinheiro Marques de Araújo <fenrrir@gmail.com>
Romain Garrigues <romain.garrigues.cs@gmail.com>
Ronny Haryanto <http://ronny.haryan.to/>
Ross Poulton <ross@rossp.org>
...
...
django/contrib/admin/checks.py
Dosyayı görüntüle @
30a389bd
...
...
@@ -104,7 +104,7 @@ class BaseModelAdminChecks:
except
FieldDoesNotExist
:
return
refer_to_missing_field
(
field
=
field_name
,
option
=
label
,
model
=
model
,
obj
=
obj
,
id
=
'admin.E037'
)
else
:
if
not
(
field
.
many_to_many
or
field
.
many_to_one
):
if
not
field
.
many_to_many
and
not
isinstance
(
field
,
models
.
ForeignKey
):
return
must_be
(
'a foreign key or a many-to-many field'
,
option
=
label
,
obj
=
obj
,
id
=
'admin.E038'
...
...
docs/releases/2.0.1.txt
Dosyayı görüntüle @
30a389bd
...
...
@@ -23,3 +23,6 @@ Bugfixes
(:ticket:`28856`).
* Reallowed filtering a queryset with ``GeometryField=None`` (:ticket:`28896`).
* Corrected admin check to allow a ``OneToOneField`` in
``ModelAdmin.autocomplete_fields`` (:ticket:`28898`).
tests/modeladmin/test_checks.py
Dosyayı görüntüle @
30a389bd
...
...
@@ -6,7 +6,9 @@ from django.core.checks import Error
from
django.forms.models
import
BaseModelFormSet
from
django.test
import
SimpleTestCase
from
.models
import
Band
,
Song
,
ValidationTestInlineModel
,
ValidationTestModel
from
.models
import
(
Band
,
Song
,
User
,
ValidationTestInlineModel
,
ValidationTestModel
,
)
class
CheckTestCase
(
SimpleTestCase
):
...
...
@@ -1243,3 +1245,14 @@ class AutocompleteFieldsTests(CheckTestCase):
site
=
AdminSite
()
site
.
register
(
Band
,
SearchFieldsAdmin
)
self
.
assertIsValid
(
AutocompleteAdmin
,
Song
,
admin_site
=
site
)
def
test_autocomplete_is_onetoone
(
self
):
class
UserAdmin
(
ModelAdmin
):
search_fields
=
(
'name'
,
)
class
Admin
(
ModelAdmin
):
autocomplete_fields
=
(
'best_friend'
,
)
site
=
AdminSite
()
site
.
register
(
User
,
UserAdmin
)
self
.
assertIsValid
(
Admin
,
ValidationTestModel
,
admin_site
=
site
)
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