mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #26056 -- Added QuerySet.values()/values_list() support for ArrayField's __overlap lookup.
Thanks Mads Jensen and kosz85 and the initial patch.
This commit is contained in:
committed by
Mariusz Felisiak
parent
81b1c167bf
commit
fbde929b19
@@ -414,6 +414,21 @@ class TestQuerying(PostgreSQLTestCase):
|
||||
[obj_1, obj_2],
|
||||
)
|
||||
|
||||
def test_overlap_values(self):
|
||||
qs = NullableIntegerArrayModel.objects.filter(order__lt=3)
|
||||
self.assertCountEqual(
|
||||
NullableIntegerArrayModel.objects.filter(
|
||||
field__overlap=qs.values_list("field"),
|
||||
),
|
||||
self.objs[:3],
|
||||
)
|
||||
self.assertCountEqual(
|
||||
NullableIntegerArrayModel.objects.filter(
|
||||
field__overlap=qs.values("field"),
|
||||
),
|
||||
self.objs[:3],
|
||||
)
|
||||
|
||||
def test_lookups_autofield_array(self):
|
||||
qs = (
|
||||
NullableIntegerArrayModel.objects.filter(
|
||||
|
||||
Reference in New Issue
Block a user