fix: ordering in queryset (#598)
This commit is contained in:
parent
5aad20e7ed
commit
9c4fcca6c1
5 changed files with 9 additions and 9 deletions
|
|
@ -91,7 +91,7 @@ class ProjectViewSet(BaseViewSet):
|
|||
projects = (
|
||||
self.get_queryset()
|
||||
.annotate(is_favorite=Exists(subquery))
|
||||
.order_by("name", "-is_favorite")
|
||||
.order_by("-is_favorite", "name")
|
||||
)
|
||||
return Response(ProjectDetailSerializer(projects, many=True).data)
|
||||
except Exception as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue