$npx skillfedfor your agent

django-rest-polymorphic

Polymorphic serializers for Django REST Framework.

With conditionsPyPI Dynamic ContentReleased Jul 20221.2M downloads / moMIT LicensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — django_rest_polymorphic-0.1.10-py2.py3-none-any.whl
v0.1.10 · released 2022-07-17 · 4 runtime deps: django, djangorestframework, django-polymorphic, six

Yes, if you are using django-polymorphic and need REST API serialization. The package is actively maintained, has low install friction, carries a permissive MIT License, and solves a real gap in Django REST Framework's handling of model inheritance. Verify compatibility with your specific Django and Python versions before adopting.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires django, djangorestframework, and django-polymorphic to be installed and configured; models must be defined using django-polymorphic's PolymorphicModel base class.
  • Low install friction with a pure-Python wheel distribution.
  • The package is actively maintained with a recent commit in 2026, though the latest release was in 2022.

License · maintenance · safety

MIT License (permissive) — MIT License permits commercial and private use with minimal restrictions, requiring only license and copyright notice retention.

last release 2022-07-17 (1489 days) · last repo commit 2026-04-13 · 183 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,223,149 downloads/mo, #4,198 on PyPI

Verify before relying

pip install django-rest-polymorphic

from django.db import models
from polymorphic.models import PolymorphicModel

class Project(PolymorphicModel):
    topic = models.CharField(max_length=30)

class ArtProject(Project):
    artist = models.CharField(max_length=30)
  • Whether the package supports Django versions beyond 3.0 (classifiers list only 2.2 and 3.0)
  • Current compatibility with modern Python versions (classifiers list up to 3.8, but latest release was 2022)
  • Whether the package remains compatible with current versions of its dependencies
Same gist for agents: .md · .json

What it is and what it does

django-rest-polymorphic bridges django-polymorphic model hierarchies with Django REST Framework's serialization system. It lets you define separate serializers for each model in an inheritance chain, then automatically routes serialization and deserialization through the correct serializer based on the model type. When you query a polymorphic model, the response includes a resource type field that identifies which subclass each object is, and POST/PUT requests use that same field to determine which serializer to apply during deserialization.

The package handles the common pattern of REST APIs that need to work with model inheritance: a base Project model with subclasses like ArtProject and ResearchProject, each with their own fields and serialization rules. Instead of flattening the hierarchy into a single serializer, django-rest-polymorphic lets you preserve the structure and handle each type appropriately.

Use it for

  • API endpoints serving inherited model hierarchies where each subclass has distinct fields and serialization requirements
  • REST services that need to return mixed collections of related model types with type information for client routing
  • Building polymorphic model APIs where POST/PUT requests specify the resource type to determine which serializer and model to instantiate
  • Multi-tenant or plugin architectures where a base model is extended by different subclasses with type-specific logic

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you are using django-polymorphic and need REST API serialization.

The package is actively maintained, has low install friction, carries a permissive MIT License, and solves a real gap in Django REST Framework's handling of model inheritance. Verify compatibility with your specific Django and Python versions before adopting.

Install

django-rest-polymorphic on PyPI

Before you install

Low install friction with a pure-Python wheel distribution. The package is actively maintained with a recent commit in 2026, though the latest release was in 2022. Depends on django, djangorestframework, django-polymorphic, and six.

Requires django, djangorestframework, and django-polymorphic to be installed and configured; models must be defined using django-polymorphic's PolymorphicModel base class.

License in practice

MIT License permits commercial and private use with minimal restrictions, requiring only license and copyright notice retention.

Quickstart

pip install django-rest-polymorphic

from django.db import models
from polymorphic.models import PolymorphicModel

class Project(PolymorphicModel):
    topic = models.CharField(max_length=30)

class ArtProject(Project):
    artist = models.CharField(max_length=30)

Verify before relying

  • Whether the package supports Django versions beyond 3.0 (classifiers list only 2.2 and 3.0)
  • Current compatibility with modern Python versions (classifiers list up to 3.8, but latest release was 2022)
  • Whether the package remains compatible with current versions of its dependencies

Package facts

LicenseMIT License permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependencies
4 packages
djangodjangorestframeworkdjango-polymorphicsix
MaintenanceActively maintained 1,489 days since the last release
Last repo commit
First released
Downloads1,223,149 / month, #4,198 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Framework :: DjangoFramework :: Django :: 2.2Framework :: Django :: 3.0Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Evidence: django_rest_polymorphic-0.1.10-py2.py3-none-any.whl

Tags

Capabilities
polymorphic serializers django restdjango rest framework inheritancepolymorphic model serializationdjango-polymorphic rest apiinherited model serializerstype-aware rest serializationdjango rest polymorphic models
Topics
django-polymorphicserializationmodel-inheritance

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “polymorphic serializers django rest”

Give your agent the search over MCP, or paste the wish link into any chat.

More Dynamic Content packages

MarkupSafe Worth it
PyPI · Dynamic Content · released Sep 2025

MarkupSafe provides a text object that escapes special characters so untrusted strings can be safely embedded in HTML and XML without injection attacks.

BSD-3-Clausecompiled wheel · 3.9+aging
797.1Mdownloads / mo
Jinja2 Worth it
PyPI · Dynamic Content · released Mar 2025

Jinja2 is a templating engine that renders dynamic content by combining templates with Python-like syntax and data, supporting template inheritance, macros, autoescaping, and sandboxed execution.

BSD-3-Clausepure Python · 3.7+aging
718.6Mdownloads / mo
soupsieve Worth it
PyPI · Python Modules · released Aug 2026

Soupsieve is a CSS selector library designed to work with Beautiful Soup 4 to select, match, and filter HTML and XML elements using modern CSS selectors from CSS level 1 through CSS level 4 specifications.

Install it if you use Beautiful Soup for HTML or XML parsing and want modern CSS selector support.

MITpure Python · 3.10+
428.6Mdownloads / mo
Werkzeug Worth it
PyPI · Application Frameworks · released Apr 2026

Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.

BSD-3-Clausepure Python · 3.9+
268.1Mdownloads / mo
Flask Worth it
PyPI · Application Frameworks · released Feb 2026

Flask is a lightweight WSGI web application framework for building web applications in Python, from simple single-page sites to complex multi-route applications.

BSD-3-Clausepure Python · 3.9+
211.4Mdownloads / mo
Mako Worth it
PyPI · Dynamic Content · released Aug 2026

Mako compiles Python-embedded templates into Python modules for fast rendering, supporting layout inheritance, custom functions, and direct Python expressions within template syntax.

MITpure Python · 3.10+
201.7Mdownloads / mo

See also django-rest-multiple-models · rest-framework-generic-relations · drf-writable-nested · drf-extra-fields · django-typomatic · drf-nested-routers · djangorestframework · drf-dynamic-fields · djangorestframework-role-filters · drf-rw-serializers