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
e554b72a
Kaydet (Commit)
e554b72a
authored
Eki 27, 2017
tarafından
Michał Pasternak
Kaydeden (comit)
Tim Graham
Kas 01, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #28749 -- Added subquery support for ArrayField's __in lookup.
üst
6e850873
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
array.py
django/contrib/postgres/fields/array.py
+3
-0
test_array.py
tests/postgres_tests/test_array.py
+9
-0
No files found.
django/contrib/postgres/fields/array.py
Dosyayı görüntüle @
e554b72a
...
@@ -242,6 +242,9 @@ class ArrayLenTransform(Transform):
...
@@ -242,6 +242,9 @@ class ArrayLenTransform(Transform):
class
ArrayInLookup
(
In
):
class
ArrayInLookup
(
In
):
def
get_prep_lookup
(
self
):
def
get_prep_lookup
(
self
):
values
=
super
()
.
get_prep_lookup
()
values
=
super
()
.
get_prep_lookup
()
if
hasattr
(
self
.
rhs
,
'_prepare'
):
# Subqueries don't need further preparation.
return
values
# In.process_rhs() expects values to be hashable, so convert lists
# In.process_rhs() expects values to be hashable, so convert lists
# to tuples.
# to tuples.
prepared_values
=
[]
prepared_values
=
[]
...
...
tests/postgres_tests/test_array.py
Dosyayı görüntüle @
e554b72a
...
@@ -176,6 +176,15 @@ class TestQuerying(PostgreSQLTestCase):
...
@@ -176,6 +176,15 @@ class TestQuerying(PostgreSQLTestCase):
self
.
objs
[:
2
]
self
.
objs
[:
2
]
)
)
def
test_in_subquery
(
self
):
IntegerArrayModel
.
objects
.
create
(
field
=
[
2
,
3
])
self
.
assertSequenceEqual
(
NullableIntegerArrayModel
.
objects
.
filter
(
field__in
=
IntegerArrayModel
.
objects
.
all
()
.
values_list
(
'field'
,
flat
=
True
)
),
self
.
objs
[
2
:
3
]
)
@unittest.expectedFailure
@unittest.expectedFailure
def
test_in_including_F_object
(
self
):
def
test_in_including_F_object
(
self
):
# This test asserts that Array objects passed to filters can be
# This test asserts that Array objects passed to filters can be
...
...
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