♻️(backend) api teams list ordering
Give the possibility to order the teams list by creation date. By default the list is ordered by creation date descending.
This commit is contained in:
@@ -5,6 +5,7 @@ from django.db.models import Func, Max, OuterRef, Q, Subquery, Value
|
||||
from rest_framework import (
|
||||
decorators,
|
||||
exceptions,
|
||||
filters,
|
||||
mixins,
|
||||
pagination,
|
||||
response,
|
||||
@@ -244,6 +245,9 @@ class TeamViewSet(
|
||||
|
||||
permission_classes = [permissions.AccessPermission]
|
||||
serializer_class = serializers.TeamSerializer
|
||||
filter_backends = [filters.OrderingFilter]
|
||||
ordering_fields = ["created_at"]
|
||||
ordering = ["-created_at"]
|
||||
queryset = models.Team.objects.all()
|
||||
|
||||
def get_queryset(self):
|
||||
|
||||
Reference in New Issue
Block a user