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
9bbb6e2d
Kaydet (Commit)
9bbb6e2d
authored
Mar 02, 2017
tarafından
Bo Marchman
Kaydeden (comit)
Tim Graham
Mar 06, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #26522 -- Fixed a nondeterministic AssertionError in QuerySet combining.
Thanks Andrew Brown for the test case.
üst
dacdcec7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
3 deletions
+22
-3
AUTHORS
AUTHORS
+1
-0
query.py
django/db/models/sql/query.py
+1
-1
models.py
tests/queries/models.py
+5
-0
tests.py
tests/queries/tests.py
+15
-2
No files found.
AUTHORS
Dosyayı görüntüle @
9bbb6e2d
...
...
@@ -110,6 +110,7 @@ answer newbie questions, and generally made Django that much better:
berto
Bill Fenner <fenner@gmail.com>
Bjørn Stabell <bjorn@exoweb.net>
Bo Marchman <bo.marchman@gmail.com>
Bojan Mihelac <bmihelac@mihelac.org>
Bouke Haarsma <bouke@haarsma.eu>
Božidar Benko <bbenko@gmail.com>
...
...
django/db/models/sql/query.py
Dosyayı görüntüle @
9bbb6e2d
...
...
@@ -126,7 +126,7 @@ class Query:
# types they are. The key is the alias of the joined table (possibly
# the table name) and the value is a Join-like object (see
# sql.datastructures.Join for more information).
self
.
alias_map
=
{}
self
.
alias_map
=
OrderedDict
()
# Sometimes the query contains references to aliases in outer queries (as
# a result of split_exclude). Correct alias quoting needs to know these
# aliases too.
...
...
tests/queries/models.py
Dosyayı görüntüle @
9bbb6e2d
...
...
@@ -663,6 +663,11 @@ class Classroom(models.Model):
students
=
models
.
ManyToManyField
(
Student
,
related_name
=
'classroom'
)
class
Teacher
(
models
.
Model
):
schools
=
models
.
ManyToManyField
(
School
)
friends
=
models
.
ManyToManyField
(
'self'
)
class
Ticket23605AParent
(
models
.
Model
):
pass
...
...
tests/queries/tests.py
Dosyayı görüntüle @
9bbb6e2d
...
...
@@ -24,8 +24,9 @@ from .models import (
ProxyCategory
,
ProxyObjectA
,
ProxyObjectB
,
Ranking
,
Related
,
RelatedIndividual
,
RelatedObject
,
Report
,
ReservedName
,
Responsibility
,
School
,
SharedConnection
,
SimpleCategory
,
SingleObject
,
SpecialCategory
,
Staff
,
StaffUser
,
Student
,
Tag
,
Task
,
Ticket21203Child
,
Ticket21203Parent
,
Ticket23605A
,
Ticket23605B
,
Ticket23605C
,
TvChef
,
Valid
,
X
,
Staff
,
StaffUser
,
Student
,
Tag
,
Task
,
Teacher
,
Ticket21203Child
,
Ticket21203Parent
,
Ticket23605A
,
Ticket23605B
,
Ticket23605C
,
TvChef
,
Valid
,
X
,
)
...
...
@@ -1382,6 +1383,18 @@ class Queries4Tests(TestCase):
self
.
assertEqual
(
len
(
combined
),
1
)
self
.
assertEqual
(
combined
[
0
]
.
name
,
'a1'
)
def
test_join_reuse_order
(
self
):
# Join aliases are reused in order. This shouldn't raise AssertionError
# because change_map contains a circular reference (#26522).
s1
=
School
.
objects
.
create
()
s2
=
School
.
objects
.
create
()
s3
=
School
.
objects
.
create
()
t1
=
Teacher
.
objects
.
create
()
otherteachers
=
Teacher
.
objects
.
exclude
(
pk
=
t1
.
pk
)
.
exclude
(
friends
=
t1
)
qs1
=
otherteachers
.
filter
(
schools
=
s1
)
.
filter
(
schools
=
s2
)
qs2
=
otherteachers
.
filter
(
schools
=
s1
)
.
filter
(
schools
=
s3
)
self
.
assertQuerysetEqual
(
qs1
|
qs2
,
[])
def
test_ticket7095
(
self
):
# Updates that are filtered on the model being updated are somewhat
# tricky in MySQL.
...
...
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