Changes between Initial Version and Version 1 of Ticket #29527, comment 1
- Timestamp:
- Jun 27, 2018, 4:44:45 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29527, comment 1
initial v1 9 9 10 10 def after(queryset, value): 11 fields = ['a', 'b', 'c', 'id']12 11 return ( 13 12 queryset 14 .annotate(rank=Func( *(F(field) for field in fields), function='ROW'))15 .filter(rank =Subquery(queryset.filter(id=value).values(*fields)))16 .order_by( *fields)13 .annotate(rank=Func(F('a'), F('b'), F('c'), F('id'), function='ROW')) 14 .filter(rank__gt=Subquery(queryset.filter(id=value).values('a', 'b', 'c', 'id'))) 15 .order_by('a', 'b', 'c', 'id') 17 16 ) 18 17 }}}