Extension for Django Rest Framework to enable simple sideloading
Project description
Extention for Django Rest Framework to enable simple sidloading
Documentation
The full documentation is at https://drf-sideloading.readthedocs.io.
Quickstart
Install drf-sideloading:
pip install drf-sideloading
Import Mixin SideloadableRelationsMixin:
from drf_sideloading.mixins import SideloadableRelationsMixin
Include mixin in view, define serializers dict sideloadable_relations and base_model_name
class ProductViewSet(SideloadableRelationsMixin, viewsets.ModelViewSet):
"""
A simple ViewSet for viewing and editing products.
"""
queryset = Product.objects.all()
serializer_class = ProductSerializer
base_model_name = 'product'
sideloadable_relations = {
'product': ProductSerializer,
'category': CategorySerializer,
'supplier': SupplierSerializer
}
Features
TODO
fix documentation
improve coverage
python3 support
manytomany relations support
Running Tests
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install tox (myenv) $ tox
Credits
Tools used in rendering this package:
History
0.1.0 (2017-07-20)
First release on PyPI.
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
drf-sideloading-0.1.0.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for drf_sideloading-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd6e85fda04bd7b8b87088fd893bd573c47c14da50544c825127619c84c46228 |
|
MD5 | 6d8035626d8f7962f3219d9558ead086 |
|
BLAKE2b-256 | bc4ab098378844dac89b3438703d81026ba102b1876630722a8166e0d1fa2dfd |