mirror of
https://github.com/django/django.git
synced 2025-07-28 23:54:02 +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:
parent
81b1c167bf
commit
fbde929b19
4 changed files with 35 additions and 1 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue