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
9ef3cab4
Kaydet (Commit)
9ef3cab4
authored
Ara 16, 2012
tarafından
Anssi Kääriäinen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Made sure join_field is always available in .join()
Refs #19385
üst
a04df803
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
compiler.py
django/db/models/sql/compiler.py
+4
-3
query.py
django/db/models/sql/query.py
+4
-2
No files found.
django/db/models/sql/compiler.py
Dosyayı görüntüle @
9ef3cab4
...
...
@@ -636,10 +636,10 @@ class SQLCompiler(object):
int_opts
=
int_model
.
_meta
continue
lhs_col
=
int_opts
.
parents
[
int_model
]
.
column
link_field
=
int_opts
.
get_ancestor_link
(
int_model
)
int_opts
=
int_model
.
_meta
alias
=
self
.
query
.
join
((
alias
,
int_opts
.
db_table
,
lhs_col
,
int_opts
.
pk
.
column
),
promote
=
promote
)
int_opts
.
pk
.
column
),
promote
=
promote
,
join_field
=
link_field
)
alias_chain
.
append
(
alias
)
else
:
alias
=
root_alias
...
...
@@ -685,10 +685,11 @@ class SQLCompiler(object):
int_opts
=
int_model
.
_meta
continue
lhs_col
=
int_opts
.
parents
[
int_model
]
.
column
link_field
=
int_opts
.
get_ancestor_link
(
int_model
)
int_opts
=
int_model
.
_meta
alias
=
self
.
query
.
join
(
(
alias
,
int_opts
.
db_table
,
lhs_col
,
int_opts
.
pk
.
column
),
promote
=
True
promote
=
True
,
join_field
=
link_field
)
alias_chain
.
append
(
alias
)
alias
=
self
.
query
.
join
(
...
...
django/db/models/sql/query.py
Dosyayı görüntüle @
9ef3cab4
...
...
@@ -944,6 +944,7 @@ class Query(object):
The 'join_field' is the field we are joining along (if any).
"""
lhs
,
table
,
lhs_col
,
col
=
connection
assert
lhs
is
None
or
join_field
is
not
None
existing
=
self
.
join_map
.
get
(
connection
,
())
if
reuse
is
None
:
reuse
=
existing
...
...
@@ -1003,8 +1004,9 @@ class Query(object):
for
field
,
model
in
opts
.
get_fields_with_model
():
if
model
not
in
seen
:
link_field
=
opts
.
get_ancestor_link
(
model
)
seen
[
model
]
=
self
.
join
((
root_alias
,
model
.
_meta
.
db_table
,
link_field
.
column
,
model
.
_meta
.
pk
.
column
))
seen
[
model
]
=
self
.
join
(
(
root_alias
,
model
.
_meta
.
db_table
,
link_field
.
column
,
model
.
_meta
.
pk
.
column
),
join_field
=
link_field
)
self
.
included_inherited_models
=
seen
def
remove_inherited_models
(
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