GeeWee / django-auto-prefetching

Automatic prefetching for Django
MIT License
231 stars 18 forks source link

Allow for generic views #18

Closed adrengifo closed 4 years ago

adrengifo commented 4 years ago

Does this only work with modelviewsets? or can it work with Generic views https://www.django-rest-framework.org/api-guide/generic-views/

GeeWee commented 4 years ago

Sorry for the slow response. Yeah absolutely. The mixin can be applied to anything that defines self.queryset and self.serializer_class

There's also some new docs that show you how to use the prefetch method directly to get the queryset with prefetches applied.

Let me know if this didn't answer your question.