Registry /
web-framework / django-rest-multiple-models
Install & Compatibility
Where this runs
tested against v2.1.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
MultipleModelMixin
✓ from drf_multiple_model import MultipleModelMixin
✗ from drf_multiple_model.views import MultipleModelMixin
MultipleModelViewSet
✓ from drf_multiple_model import MultipleModelViewSet
VERSION
✓ from drf_multiple_model import VERSION
Define a view that returns multiple querysets grouped by label or flat.
# views.py
from drf_multiple_model.views import ObjectMultipleModelAPIView
from .models import Author, Book
from .serializers import AuthorSerializer, BookSerializer
class MixedAPIView(ObjectMultipleModelAPIView):
querylist = [
{'queryset': Author.objects.all(), 'serializer_class': AuthorSerializer},
{'queryset': Book.objects.all(), 'serializer_class': BookSerializer, 'label': 'books'},
]
# Optional: sorting, pagination, etc.
Upgrade
Version history
2.1.3latest on PyPI · released Dec 1, 2018
Audit
Dependencies
djangorequiredCore framework dependency.
djangorestframeworkrequiredRequired for the view and mixin.