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
baff4dd3
Kaydet (Commit)
baff4dd3
authored
Haz 30, 2016
tarafından
Andrew Nester
Kaydeden (comit)
Tim Graham
Haz 30, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #25292 -- Fixed crash in ManyToManyField.through_fields check.
üst
490107f1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
base.py
django/db/models/base.py
+4
-0
test_relative_fields.py
tests/invalid_models_tests/test_relative_fields.py
+16
-0
No files found.
django/db/models/base.py
Dosyayı görüntüle @
baff4dd3
...
...
@@ -1687,6 +1687,10 @@ class Model(six.with_metaclass(ModelBase)):
)
for
f
in
cls
.
_meta
.
local_many_to_many
:
# Skip nonexistent models.
if
isinstance
(
f
.
remote_field
.
through
,
six
.
string_types
):
continue
# Check if auto-generated name for the M2M field is too long
# for the database.
for
m2m
in
f
.
remote_field
.
through
.
_meta
.
local_fields
:
...
...
tests/invalid_models_tests/test_relative_fields.py
Dosyayı görüntüle @
baff4dd3
...
...
@@ -307,6 +307,22 @@ class RelativeFieldTests(SimpleTestCase):
]
self
.
assertEqual
(
errors
,
expected
)
def
test_missing_relationship_model_on_model_check
(
self
):
class
Person
(
models
.
Model
):
pass
class
Group
(
models
.
Model
):
members
=
models
.
ManyToManyField
(
'Person'
,
through
=
'MissingM2MModel'
)
self
.
assertEqual
(
Group
.
check
(),
[
Error
(
"Field specifies a many-to-many relation through model "
"'MissingM2MModel', which has not been installed."
,
obj
=
Group
.
_meta
.
get_field
(
'members'
),
id
=
'fields.E331'
,
),
])
@isolate_apps
(
'invalid_models_tests'
)
def
test_many_to_many_through_isolate_apps_model
(
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