You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For now, the ordered_by kwarg is use only for objects already fetch
defget_queryset(self, *args: tuple, **kwargs: dict) ->QuerySet:
""" Return the queryset filtered by app + contentype and optionaly channel and channel object if it's given """qs=super().get_queryset(*args, **kwargs)
[...]
ifself.ordered_by:
order=""ifself.ordered_by.startswith("-"):
order="-"ordered_by=self.ordered_by[1:]
else:
ordered_by=self.ordered_byqs=qs.order_by(f"{order}content_data__{ordered_by}")
returnqs
however many API endpoint support sorting as well (e.g gitlab milestone) but have default ordering. So retrieving default "10 milestone" would be the "10 first created" using default gitlab milestone API endpoint. But let's say we want the "10 last updated" or "10 last created" (i.e. most recent ones)? It would be super useful to allow sorting at the proxy level.
The text was updated successfully, but these errors were encountered:
For now, the
ordered_by
kwarg is use only for objects already fetchhowever many API endpoint support sorting as well (e.g gitlab milestone) but have default ordering. So retrieving default "10 milestone" would be the "10 first created" using default gitlab milestone API endpoint. But let's say we want the "10 last updated" or "10 last created" (i.e. most recent ones)? It would be super useful to allow sorting at the proxy level.
The text was updated successfully, but these errors were encountered: