Skip to content

Commit

Permalink
perf(order): ordering on modelset
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Oct 3, 2024
1 parent d1d39b7 commit 0d413b3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ class ModelViewSet(
InBBoxFilter, # it will take bbox like this api/v1/model/?in_bbox=-90,29,-89,35 ,
DjangoFilterBackend,
filters.SearchFilter,
filters.OrderingFilter,
)
serializer_class = ModelSerializer
filterset_fields = {
Expand All @@ -252,6 +253,7 @@ class ModelViewSet(
"created_by": ["exact"],
"id": ["exact"],
}
ordering_fields = ["created_at", "last_modified", "id", "status"]
search_fields = ["name"]


Expand Down

0 comments on commit 0d413b3

Please sign in to comment.