mirror of
https://github.com/django/django.git
synced 2025-08-18 17:50:58 +00:00
Fixed #36405 -- Fixed Aggregate.order_by using OuterRef.
co-authored-by: Simon Charette <charette.s@gmail.com>
This commit is contained in:
parent
b8e5a8a9a2
commit
c2615a0500
4 changed files with 45 additions and 5 deletions
|
@ -364,6 +364,18 @@ class TestGeneralAggregate(PostgreSQLTestCase):
|
|||
[[], [], [], []],
|
||||
)
|
||||
|
||||
def test_array_agg_with_order_by_outer_ref(self):
|
||||
StatTestModel.objects.annotate(
|
||||
atm_ids=Subquery(
|
||||
AggregateTestModel.objects.annotate(
|
||||
ids=ArrayAgg(
|
||||
"id",
|
||||
order_by=[OuterRef("int1")],
|
||||
)
|
||||
).values("ids")[:1]
|
||||
)
|
||||
)
|
||||
|
||||
def test_bit_and_general(self):
|
||||
values = AggregateTestModel.objects.filter(integer_field__in=[0, 1]).aggregate(
|
||||
bitand=BitAnd("integer_field")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue