Skip to content

dealertrack/django-rest-framework-braces

Repository files navigation

Django Rest Framework Braces

https://badge.fury.io/py/django-rest-framework-braces.png https://travis-ci.org/dealertrack/django-rest-framework-braces.svg?branch=master

Collection of utilities for working with DRF. Name inspired by django-braces.

Installing

Easiest way to install django-rest-framework-braces is by using pip:

$ pip install django-rest-framework-braces

Usage

Once installed, you can use any of the supplied utilities by simply importing them. For example:

from drf_braces.mixins import MultipleSerializersViewMixin

class MyViewSet(MultipleSerializersViewMixin, GenericViewSet):
    def create(self, request):
        serializer = self.get_serializer(serializer_class=MySerializer)
        ...

For full list of available utilities, please refer to the documentation.

Testing

To run the tests you need to install testing requirements first:

$ make install

Then to run tests, you can use use Makefile command:

$ make test