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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rest_framework_mixins-1.0.0.tar.gz.
File metadata
- Download URL: rest_framework_mixins-1.0.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.0 CPython/3.11.7 Linux/6.2.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7e4d7115f88031b455b50e56e284657d53ca79fed38df012301cd4af085c74c
|
|
| MD5 |
cda8b8b3be462d24135ebc2368903c58
|
|
| BLAKE2b-256 |
29f8efaa30b5b7eac786355b6a93dbea9f3581c1c0f23ec8f2e1fcca7656c09e
|
File details
Details for the file rest_framework_mixins-1.0.0-py3-none-any.whl.
File metadata
- Download URL: rest_framework_mixins-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.0 CPython/3.11.7 Linux/6.2.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc24a9620ffc6ec1ddf8453ac988b2a0b633d3483124973a3e4503ce7ccdd04e
|
|
| MD5 |
5eec59739f2b168d4e7bddba25424214
|
|
| BLAKE2b-256 |
1cda69ad672e60521c097c7ce3db35620846799b8bcb2f06ea1c47859f5cc8ff
|