Reputation: 1525
What i want to do is to filter the queryset for every action on the resource by the authenticated user's ID which is a foreign key on the model, how can I read it when defining the query set?
class RunSessionViewSet(viewsets.ModelViewSet):
"""API endpoint for listing and creating sprints."""
queryset = RunningSession.objects.order_by('createdDate')
serializer_class = RunSessionSerializer
Upvotes: 0
Views: 1388