Skip to content

Latest commit

 

History

History
56 lines (35 loc) · 1.53 KB

README.md

File metadata and controls

56 lines (35 loc) · 1.53 KB

Django Rest Framework Extended ViewSet

https://pypi.python.org/pypi/drf_extended_viewset https://travis-ci.com/ivlevdenis/drf_extended_viewset https://drf-extended-viewset.readthedocs.io/en/latest/?badge=latest https://pyup.io/repos/github/ivlevdenis/drf_extended_viewset/

Django Rest Framework extension for implement by action serializers, permissions & /etc

Dependencies

  • Python 3.7+
  • Django 2.0+
  • Django Rest Framework 3.10+

Setup

You can install the library directly from pypi using pip:

$ pip install drf-extended-viewset

License

Free software: MIT license

Features

class MyModelViewSet(ExtendedModelViewSet):
    serializer_class_map = {
        'list': ListMyModelSerializer,
        'retrieve': RetrieveMyModelSerializer,
        'update': UpdateMyModelSerializer,
        ...
    }
    permission_classes_map = {
        'list': AllowAny,
        'retrieve': IsAuthenticated,
        'update': (IsOwner | IsAdminUser),
        ...
    }

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.