File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -575,6 +575,11 @@ async def test_annotate_order_expression(self):
575575 )
576576 self .assertEqual (data [0 ] + 1 , data [1 ])
577577
578+ async def test_annotate_order_rawsql (self ):
579+ qs = IntFields .annotate (idp = RawSQL ("id+1" )).order_by ("-idp" )
580+ data = await qs .first ().values_list ("id" , "idp" )
581+ self .assertEqual (data [0 ] + 1 , data [1 ])
582+
578583 async def test_annotate_expression_filter (self ):
579584 count = await IntFields .annotate (intnum1 = F ("intnum" ) + 1 ).filter (intnum1__gt = 30 ).count ()
580585 self .assertEqual (count , 23 )
Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ def resolve_ordering(
230230 )
231231 elif field_name in annotations :
232232 if isinstance (annotation := annotations [field_name ], Term ):
233- term = annotations
233+ term : Term = annotation
234234 else :
235235 annotation_info = annotation .resolve (
236236 ResolveContext (
You can’t perform that action at this time.
0 commit comments