A collection of DRF mixins combinations
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for rest_framework_mixins-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8d43816a6f39da833a34b9963f3579d842d643b324553eff2733bc83caaacbf |
|
MD5 | 0ab738b7a6f7719317802cdddba06657 |
|
BLAKE2b-256 | cc73b2a3d6f304360486dc737bbc4c640b53e51a9d5ac62fe44494d4185683ff |
Close
Hashes for rest_framework_mixins-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1109f82d21f16611a43071cfd83c964e66e59a844ed948b3ff7f28ca121a6d28 |
|
MD5 | 15b73b7eeb4784c7c913565ff01638b9 |
|
BLAKE2b-256 | a759e666c940a48d3ac905af01fe22af6074ab23b3174c382c801f5724beb497 |