Metadata-Version: 2.1
Name: rest-framework-mixins
Version: 0.1.3
Summary: A collection of DRF mixins combinations
Home-page: https://github.com/Qu4tro/rest_framework_mixins
License: MIT
Keywords: django,djangorestframework,drf,restframework,rest_framework,mixins
Author: Xavier Francisco
Author-email: xavier.n.francisco@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: django (>=4.1,<5.0)
Requires-Dist: djangorestframework
Project-URL: Repository, https://github.com/Qu4tro/rest_framework_mixins
Description-Content-Type: text/markdown

# rest-framework-mixins

## Installation

`pip install rest_framework_mixins`

## Usage

This package provides all combinations of the mixins provided by rest_framework.  
All combinations follow the same format: `{initials}Mixin.

The initials correspond to the following methods, in this specific order:

- L: `list()`  
- R: `retrieve()`  
- C: `create()`  
- U: `update()`  
- P: `partial_update()`  
- D: `delete()`  

So for example, to import a mixin that gives us list, retrieve and create,
we can do the following:

```
from rest_framework_mixins import LRCMixin

class CreateListRetrieveViewSet(LRCMixin, viewsets.GenericViewSet):
    """
    A viewset that provides `retrieve`, `create`, and `list` actions.

    To use it, override the class and set the `.queryset` and
    `.serializer_class` attributes.
    """
    pass
```

> Adapted from [DRF's documentation](https://www.django-rest-framework.org/api-guide/viewsets/#example_3)

