: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](https://github.com/beda-software/drf-nested-browsable.git)) that bring their own forms for the Browsable API renderer.
## Try it out
This project's dependencies are managed using [`poetry`](https://python-poetry.org/)
```bash
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`](https://github.com/heywbj/django-rest-framework-recursive)
### To do
* Write documentation / Auto-generate it from the docstrings ([pdoc](https://pdoc.dev/) ?)
* 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
Raw data
{
"_id": null,
"home_page": "https://pierre-couy.dev/projects/drf-nested-browsable.html",
"name": "drf-nested-browsable",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "django, rest framework, drf, browsable api, nested serializers",
"author": "Pierre Couy",
"author_email": "contact@pierre-couy.dev",
"download_url": "https://files.pythonhosted.org/packages/ea/2e/dd24e79878d10880477dec8a05b72db08faa0e5d6a82347bcb402575473b/drf_nested_browsable-0.4.0.tar.gz",
"platform": null,
"description": ":warning: Work In Progress :warning:\n\n# Writable Nested Serializers with Browsable API Forms\n\nThis plugin is intended to provide writable nested serializers (similar to [the recommended plugin from DRF documentation](https://github.com/beda-software/drf-nested-browsable.git)) that bring their own forms for the Browsable API renderer.\n\n## Try it out\n\nThis project's dependencies are managed using [`poetry`](https://python-poetry.org/)\n\n```bash\ngit clone https://github.com/pcouy/drf-nested-browsable\ncd drf-nested-browsable\npoetry install\ncd example\npoetry shell\npython manage.py migrate\npython manage.py runserver\n```\n\nThe above commands will install the dependencies, run the DB migrations, and launch a development server of the example project that uses the provided serializers.\n\n## Current state of the project\n\n### Done\n\n* Ability to write to a reverse `ForeignKey` relationship using serializer `Meta` class\n* Dynamic form for `WritableNestedListSerializer` that allows adding and removing children from the Browsable API\n* Arbitrary nesting depth\n* Dynamically removing the parent field from serializers when used as an inner serializer\n* Basic example\n* Support `RecursiveField` from\n [`djangorestframework-recursive`](https://github.com/heywbj/django-rest-framework-recursive)\n\n### To do\n\n* Write documentation / Auto-generate it from the docstrings ([pdoc](https://pdoc.dev/) ?)\n* Write tests/specs (from example ?)\n* Better form design\n* Add `ManyToMany` to example (and test it)\n* Consider database schema constrains :\n * Look into what `drf-writable-nested` does with uniqueness\n * When the foreign key can be `null`, show a multiple select field for attaching orphan instances to a parent instance\n * Show a multiple select field for `ManyToMany` relationships\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Writable nested serializers with forms for the Browsable API",
"version": "0.4.0",
"project_urls": {
"Homepage": "https://pierre-couy.dev/projects/drf-nested-browsable.html",
"Repository": "https://github.com/pcouy/drf-nested-browsable"
},
"split_keywords": [
"django",
" rest framework",
" drf",
" browsable api",
" nested serializers"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3dc6f9090fd3538fbd220a56c45ff74c04888f7496ea66d93d919a43851787cb",
"md5": "2c75fd4ef34e0c79436620b0881860f6",
"sha256": "8588a70413913e87f601c357fb10bd072d685d073ab33638dcef1b2aa5c3d48d"
},
"downloads": -1,
"filename": "drf_nested_browsable-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2c75fd4ef34e0c79436620b0881860f6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 7546,
"upload_time": "2024-04-30T11:07:16",
"upload_time_iso_8601": "2024-04-30T11:07:16.820890Z",
"url": "https://files.pythonhosted.org/packages/3d/c6/f9090fd3538fbd220a56c45ff74c04888f7496ea66d93d919a43851787cb/drf_nested_browsable-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ea2edd24e79878d10880477dec8a05b72db08faa0e5d6a82347bcb402575473b",
"md5": "76a18b2df1ef2fdaaf1a7da8e769064e",
"sha256": "f1a02b98bd1bcaaef25f267efee4aa79deb4047235b2edb9d2cc914240fa64de"
},
"downloads": -1,
"filename": "drf_nested_browsable-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "76a18b2df1ef2fdaaf1a7da8e769064e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 6243,
"upload_time": "2024-04-30T11:07:18",
"upload_time_iso_8601": "2024-04-30T11:07:18.416453Z",
"url": "https://files.pythonhosted.org/packages/ea/2e/dd24e79878d10880477dec8a05b72db08faa0e5d6a82347bcb402575473b/drf_nested_browsable-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-30 11:07:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pcouy",
"github_project": "drf-nested-browsable",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "drf-nested-browsable"
}