Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created August 25, 2020 06:03
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/392b271c7ac2ebba12f0ccf7721f048e to your computer and use it in GitHub Desktop.
Save velotiotech/392b271c7ac2ebba12f0ccf7721f048e to your computer and use it in GitHub Desktop.
# Remember to use mixin before the generics
class BookListCreateAPIView(DynamicPaginationMixin, 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