# django-commons/django-polymorphic

Improved Django model inheritance with automatic downcasting

Repository: https://github.com/django-commons/django-polymorphic
Canonical: https://ross.abutalabs.com/products/django-polymorphic
Homepage: https://django-polymorphic.readthedocs.io
Language: Python
License: NOASSERTION
License Family: other
Topics: django, django-orm, django-admin, django-formsets, object-oriented, oop, polymorphism
Last push: 2026-08-17T21:35:48+00:00

## Health v2 (maintenance only)
Score: 97/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 95, longevity 100
- inputs: {"age_days": 5681, "days_push": 16, "days_rel": 32, "gap_med": 3.0, "n_releases_24m": 31}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1833, forks 304 (observed 2026-08-28T04:05:42.418695+00:00)

## What it is
A Django library providing seamless polymorphic model inheritance with automatic downcasting, so queries on a base model return instances of the correct subclass. It integrates with the Django ORM, admin, and formsets.

## Use cases
- query a base Django model and get subclass instances back
- implement polymorphic model inheritance in Django
- manage inherited models in the Django admin
- build formsets for Django model hierarchies
- avoid manual downcasting of Django model query results

## When to choose
- you use Django's ORM and need inherited models returned as their concrete classes
- you want polymorphic models integrated with Django admin and formsets
- you need a mature, well-tested solution for Django model inheritance

## When to avoid
- you don't use Django or its ORM
- you need database-level table inheritance rather than ORM-level downcasting
- query performance is critical, since polymorphic queries add joins and overhead

## Facets
- artifact type: library
- maturity: active
- function: orm, database
- domain: web-development, backend, databases
- platform: python
- tags: django, model-inheritance, polymorphism, downcasting, django-admin, django-formsets, web-server

## Member repositories
- django-commons/django-polymorphic (main) score 97

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:42.418695+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:18:37.923028+00:00, confidence not recorded.
  - readme: https://github.com/django-commons/django-polymorphic (fetched 2026-08-28T04:05:42.418695+00:00, sha 1b19d9cd703f)
  - registry_pypi: https://pypi.org/pypi/django-polymorphic/json (fetched 2026-08-29T10:58:36.712089+00:00, sha 856d594a2dc1)
- Data as of 2026-08-30T08:39:29.467469+00:00.
