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
e1347e92
Kaydet (Commit)
e1347e92
authored
Tem 26, 2014
tarafından
Abraham Martin
Kaydeden (comit)
Andrew Godwin
Tem 26, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #23101 db_table wasn't copied in deconstruct
Forward port of
999758fc
from stable/1.7.x
üst
805774df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
related.py
django/db/models/fields/related.py
+2
-0
tests.py
tests/field_deconstruction/tests.py
+6
-0
No files found.
django/db/models/fields/related.py
Dosyayı görüntüle @
e1347e92
...
...
@@ -2138,6 +2138,8 @@ class ManyToManyField(RelatedField):
def
deconstruct
(
self
):
name
,
path
,
args
,
kwargs
=
super
(
ManyToManyField
,
self
)
.
deconstruct
()
# Handle the simpler arguments
if
self
.
db_table
is
not
None
:
kwargs
[
'db_table'
]
=
self
.
db_table
if
self
.
rel
.
db_constraint
is
not
True
:
kwargs
[
'db_constraint'
]
=
self
.
rel
.
db_constraint
if
"help_text"
in
kwargs
:
...
...
tests/field_deconstruction/tests.py
Dosyayı görüntüle @
e1347e92
...
...
@@ -271,6 +271,12 @@ class FieldDeconstructionTests(TestCase):
self
.
assertEqual
(
path
,
"django.db.models.ManyToManyField"
)
self
.
assertEqual
(
args
,
[])
self
.
assertEqual
(
kwargs
,
{
"to"
:
"auth.Permission"
,
"through"
:
"auth.Group"
})
# Test custom db_table
field
=
models
.
ManyToManyField
(
"auth.Permission"
,
db_table
=
"custom_table"
)
name
,
path
,
args
,
kwargs
=
field
.
deconstruct
()
self
.
assertEqual
(
path
,
"django.db.models.ManyToManyField"
)
self
.
assertEqual
(
args
,
[])
self
.
assertEqual
(
kwargs
,
{
"to"
:
"auth.Permission"
,
"db_table"
:
"custom_table"
})
@override_settings
(
AUTH_USER_MODEL
=
"auth.Permission"
)
def
test_many_to_many_field_swapped
(
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