order by position for establishment employee

This commit is contained in:
alex 2020-01-17 14:02:46 +03:00
parent a915cff73d
commit 4a7eb22291

View File

@ -196,10 +196,11 @@ class EstablishmentEmployeeListView(generics.ListCreateAPIView):
"""Establishment emplyoees list view."""
permission_classes = (permissions.AllowAny,)
serializer_class = serializers.EstablishmentEmployeeBackSerializer
pagination_class = None
def get_queryset(self):
establishment_id = self.kwargs['establishment_id']
return models.EstablishmentEmployee.objects.filter(establishment__id=establishment_id)
return models.EstablishmentEmployee.objects.filter(establishment__id=establishment_id).order_by('position')
class EmployeeRUDView(generics.RetrieveUpdateDestroyAPIView):