drf-writable-nested
Writable nested helpers for django-rest-framework's serializers
Decision gist · record as of 2026-08-14
Yes, if you are building Django REST Framework APIs that accept nested model data. The package is stable (BSD licensed, no known vulnerabilities, 1139 GitHub stars), has low install friction, and solves a common pain point in DRF. The aging maintenance status (522 days since last release) is a minor concern for long-term support, but the repository remains active and the package supports current Django and Python versions. Install it when you need to handle nested creates/updates; skip it if your API only works with flat, single-model payloads.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Django 4.2+ and djangorestframework 3.14+; Python 3.9 or later.
- Low install friction with no runtime dependencies.
- Maintenance status is aging—last release was 522 days ago, though the repository remains active with recent commits and 1139 stars.
License · maintenance · safety
BSD (permissive) — BSD license is permissive, allowing commercial and private use with minimal restrictions. Include a copy of the license in distributions.
last release 2025-03-10 (522 days) · last repo commit 2025-09-15 · 1,139 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 735,738 downloads/mo, #5,195 on PyPI
Alternatives
Verify before relying
pip install drf-writable-nested
from drf_writable_nested.serializers import WritableNestedModelSerializer
class ProfileSerializer(WritableNestedModelSerializer):
sites = SiteSerializer(many=True)
access_key = AccessKeySerializer(allow_null=True)
class Meta:
model = Profile
fields = ('pk', 'sites', 'access_key')
data = {'sites': [{'url': 'http://example.com'}], 'access_key': {'key': 'abc'}}
serializer = ProfileSerializer(data=data)
serializer.is_valid(raise_exception=True)
instance = serializer.save()- Whether the aging maintenance status (522 days since last release) affects stability for new Django/Python versions beyond 5.2 and 3.13.
- Performance characteristics when handling deeply nested or large-scale related data structures.
- Compatibility with third-party DRF extensions or custom serializer mixins beyond those documented.
What it is and what it does
DRF Writable Nested is a Django REST Framework extension that lets you serialize and deserialize nested model relationships—OneToOne, ForeignKey, ManyToMany, and GenericRelation—in a single API request. Instead of making separate calls to create or update related objects, you pass a nested data structure to the serializer, and it handles all the database operations atomically.
The package provides WritableNestedModelSerializer as the main class, plus NestedCreateMixin and NestedUpdateMixin for more granular control. It also includes UniqueFieldsMixin to handle validation of unique fields on nested updates. The serializer automatically creates or updates all related instances and returns a complete object graph, making it useful for APIs that need to accept complex, hierarchical input in a single request.
Use it for
- Accept a user profile with nested sites, access keys, and avatars in one POST request instead of multiple API calls.
- Update a parent object and its related children (e.g., a voucher and its line items) via a single PATCH or PUT.
- Build admin-style APIs where clients submit entire object trees with related data and expect atomic creation or update.
- Simplify client code by eliminating the need to orchestrate multiple serializer calls for interdependent model hierarchies.
- Handle reverse relationships (e.g., a user's profile, or a profile's avatars) without flattening or restructuring the data.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are building Django REST Framework APIs that accept nested model data.
The package is stable (BSD licensed, no known vulnerabilities, 1139 GitHub stars), has low install friction, and solves a common pain point in DRF. The aging maintenance status (522 days since last release) is a minor concern for long-term support, but the repository remains active and the package supports current Django and Python versions. Install it when you need to handle nested creates/updates; skip it if your API only works with flat, single-model payloads.
Install
drf-writable-nested on PyPI
Before you install
Low install friction with no runtime dependencies. Maintenance status is aging—last release was 522 days ago, though the repository remains active with recent commits and 1139 stars. Suitable for projects on Django 4.2–5.2 and Python 3.9–3.13.
Requires Django 4.2+ and djangorestframework 3.14+; Python 3.9 or later.
License in practice
BSD license is permissive, allowing commercial and private use with minimal restrictions. Include a copy of the license in distributions.
Quickstart
pip install drf-writable-nested
from drf_writable_nested.serializers import WritableNestedModelSerializer
class ProfileSerializer(WritableNestedModelSerializer):
sites = SiteSerializer(many=True)
access_key = AccessKeySerializer(allow_null=True)
class Meta:
model = Profile
fields = ('pk', 'sites', 'access_key')
data = {'sites': [{'url': 'http://example.com'}], 'access_key': {'key': 'abc'}}
serializer = ProfileSerializer(data=data)
serializer.is_valid(raise_exception=True)
instance = serializer.save()
Verify before relying
- Whether the aging maintenance status (522 days since last release) affects stability for new Django/Python versions beyond 5.2 and 3.13.
- Performance characteristics when handling deeply nested or large-scale related data structures.
- Compatibility with third-party DRF extensions or custom serializer mixins beyond those documented.
Package facts
| License | BSD permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 522 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 735,738 / month, #5,195 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTP |
Evidence: drf_writable_nested-0.7.2-py3-none-any.whl
Tags
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 › “django rest framework nested serializer”
- drf-writable-nestedExtends Django REST Framework serializers to handle creation and…
- drf-flex-fieldsAdds dynamic field expansion and sparse field selection to Django…
- drf-extensionsProvides mixins, decorators, and utilities that extend Django REST…
Give your agent the search over MCP, or paste the wish link into any chat.
More WWW/HTTP packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
HTTPX is a fully featured HTTP client library for Python that provides both sync and async APIs, with support for HTTP/1.1 and HTTP/2, plus an integrated command-line client.
Install it if you are building new projects or modernizing existing ones that rely on HTTP.
A minimal low-level HTTP client library that sends HTTP requests with thread-safe and task-safe connection pooling, supporting HTTP/1.1, HTTP/2, proxies, and both sync and async interfaces.
aiohttp is an async HTTP client and server framework built on asyncio, supporting both WebSockets and middleware-based routing for building concurrent web applications.
Install it if you need async HTTP client or server capabilities in asyncio-based applications.
See also django-modelcluster · djangorestframework-recursive · drf-nested-routers · rest-framework-generic-relations · django-solo · django-rest-polymorphic · drf-rw-serializers · django-typomatic · drf-dynamic-fields · swapper