{"id":23595,"library":"django-rest-multiple-models","title":"Django REST Multiple Models","description":"Provides a generic view (and mixin) for returning multiple models or querysets from a single Django REST Framework endpoint. Current version 2.1.3. Maintenance appears sporadic.","status":"active","version":"2.1.3","language":"python","source_language":"en","source_url":"https://github.com/Axiologue/DjangoRestMultipleModels","tags":["django-rest-framework","multiple-models","api","queryset"],"install":[{"cmd":"pip install django-rest-multiple-models","lang":"bash","label":"Latest stable release"}],"dependencies":[{"reason":"Core framework dependency.","package":"django","optional":false},{"reason":"Required for the view and mixin.","package":"djangorestframework","optional":false}],"imports":[{"wrong":"from drf_multiple_model.views import MultipleModelMixin","symbol":"MultipleModelMixin","correct":"from drf_multiple_model import MultipleModelMixin"},{"symbol":"MultipleModelViewSet","correct":"from drf_multiple_model import MultipleModelViewSet"},{"symbol":"VERSION","correct":"from drf_multiple_model import VERSION"}],"quickstart":{"code":"# views.py\nfrom drf_multiple_model.views import ObjectMultipleModelAPIView\nfrom .models import Author, Book\nfrom .serializers import AuthorSerializer, BookSerializer\n\nclass MixedAPIView(ObjectMultipleModelAPIView):\n    querylist = [\n        {'queryset': Author.objects.all(), 'serializer_class': AuthorSerializer},\n        {'queryset': Book.objects.all(), 'serializer_class': BookSerializer, 'label': 'books'},\n    ]\n    # Optional: sorting, pagination, etc.","lang":"python","description":"Define a view that returns multiple querysets grouped by label or flat."},"warnings":[{"fix":"Replace 'MultipleModelAPIView' with 'ObjectMultipleModelAPIView'. See changelog for full migration.","message":"v2.0 renamed MultipleModelAPIView to ObjectMultipleModelAPIView, and removed the old mixin-based API. Update imports accordingly.","severity":"breaking","affected_versions":"1.x -> 2.x"},{"fix":"Set 'pagination' inside each querylist dict (or use class-level 'pagination'). See docs.","message":"Pagination in v2.0 changed from a global setting to a per-querylist attribute. The old 'pagination_count' attribute is removed.","severity":"breaking","affected_versions":"1.x -> 2.x"},{"fix":"Use 'FlatMultipleModelAPIView' when a flat list is desired.","message":"The 'flat' property (FlatMultipleModelAPIView) returns all items in a single list. Without 'flat', each label is a key with a list. Ensure client expectations match.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"search_vec":"'2.1.3':26 'api':37 'appear':28 'current':24 'django':1,20,31 'django-rest-framework':30 'endpoint':23 'framework':22,33 'generic':7 'mainten':27 'mixin':10 'model':4,14,36 'multipl':3,13,35 'multiple-model':34 'provid':5 'queryset':16,38 'rest':2,21,32 'return':12 'singl':19 'sporad':29 'version':25 'view':8","created_at":"2026-05-01T08:08:35.784575+00:00","updated_at":"2026-05-01T08:08:35.784575+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'MultipleModelMixin' from 'drf_multiple_model' (/tmp/tmpoi3di_2t/venv/lib/python3.12/site-packages/drf_multiple_model/__init__.py)"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.1.3","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/Axiologue/DjangoRestMultipleModels","docs":null,"changelog":null,"pypi":"https://pypi.org/project/django-rest-multiple-models/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","serialization","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}