[Django]-RetrieveAPIView without lookup field?

29👍

You need override get_object

def get_object(self):
  queryset = self.get_queryset()
  obj = get_object_or_404(queryset, user=self.request.user)
  return obj

Leave a comment