Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created August 25, 2020 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/310a7446febfcc6fe6813ca293c971ec to your computer and use it in GitHub Desktop.
Save velotiotech/310a7446febfcc6fe6813ca293c971ec to your computer and use it in GitHub Desktop.
class BookListCreateAPIView(generics.ListCreateAPIView):
serializer_class = BookSerializer
def get_queryset(self):
queryset = Book.objects.select_related("author").all()
return queryset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment