Skip to main content

Writable nested serializers with forms for the Browsable API

Project description

:warning: Work In Progress :warning:

Writable Nested Serializers with Browsable API Forms

This plugin is intended to provide writable nested serializers (similar to the recommended plugin from DRF documentation) that bring their own forms for the Browsable API renderer.

Try it out

This project's dependencies are managed using poetry

git clone https://github.com/pcouy/drf-nested-browsable
cd drf-nested-browsable
poetry install
cd example
poetry shell
python manage.py migrate
python manage.py runserver

The above commands will install the dependencies, run the DB migrations, and launch a development server of the example project that uses the provided serializers.

Current state of the project

Done

  • Ability to write to a reverse ForeignKey relationship using serializer Meta class
  • Dynamic form for WritableNestedListSerializer that allows adding and removing children from the Browsable API
  • Arbitrary nesting depth
  • Dynamically removing the parent field from serializers when used as an inner serializer
  • Basic example
  • Support RecursiveField from djangorestframework-recursive

To do

  • Write documentation / Auto-generate it from the docstrings (pdoc ?)
  • Write tests/specs (from example ?)
  • Better form design
  • Add ManyToMany to example (and test it)
  • Consider database schema constrains :
    • Look into what drf-writable-nested does with uniqueness
    • When the foreign key can be null, show a multiple select field for attaching orphan instances to a parent instance
    • Show a multiple select field for ManyToMany relationships

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

drf_nested_browsable-0.4.1.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

drf_nested_browsable-0.4.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file drf_nested_browsable-0.4.1.tar.gz.

File metadata

  • Download URL: drf_nested_browsable-0.4.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.6.26-1-MANJARO

File hashes

Hashes for drf_nested_browsable-0.4.1.tar.gz
Algorithm Hash digest
SHA256 6d90322b2e135dcb035c16bb5cef6fa79ed0dab8c83d402d7cc342e6bf49b5c4
MD5 1cd9b1143a1b4847ca0677c0ad1ef4db
BLAKE2b-256 f072e4f7e510465123e2d585b594a2d9cbaadcb4f76002539c8d6f3b9c3012ba

See more details on using hashes here.

File details

Details for the file drf_nested_browsable-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for drf_nested_browsable-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1ae096f3bf746cd99252713e109d374bc429e78cf395dd7321d62188157e1165
MD5 5b252e0560519e587d9c998db427623c
BLAKE2b-256 94b40cbfd1fddcf712321d4e8c05f042fefe2120d9d62150f542dfdeb2afcc6a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page