Add missing import in /api-guide/viewsets/ example (#9235)

This commit is contained in:
Marcelo Galigniana 2024-01-25 12:01:06 +01:00 committed by GitHub
parent ab694eccde
commit 2797c0f216
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -311,7 +311,7 @@ You may need to provide custom `ViewSet` classes that do not have the full set o
To create a base viewset class that provides `create`, `list` and `retrieve` operations, inherit from `GenericViewSet`, and mixin the required actions: To create a base viewset class that provides `create`, `list` and `retrieve` operations, inherit from `GenericViewSet`, and mixin the required actions:
from rest_framework import mixins from rest_framework import mixins, viewsets
class CreateListRetrieveViewSet(mixins.CreateModelMixin, class CreateListRetrieveViewSet(mixins.CreateModelMixin,
mixins.ListModelMixin, mixins.ListModelMixin,