drf-writable-nested:适用于Django REST Framework的可写嵌套模型序列化器

时间:2021-04-29 18:23:27
【文件属性】:
文件名称:drf-writable-nested:适用于Django REST Framework的可写嵌套模型序列化器
文件大小:26KB
文件格式:ZIP
更新时间:2021-04-29 18:23:27
Python DRF可写嵌套 这是Django REST Framework的可写嵌套模型序列化程序,可让您使用相关的嵌套数据创建/更新模型。 支持以下关系: 一对一(正向/反向) 外键(正向/反向) ManyToMany(正/反向不包括与直通模型的m2m关系) GenericRelation(这总是唯一的反向) 要求 Python(3.5、3.6、3.7、3.8) Django(2.2、3.0、3.1) djangorestframework(3.8+) 安装 pip install drf-writable-nested 用法 例如,对于以下模型结构: from django . db import models class Site ( models . Model ): url = models . CharField ( max_length = 100 ) clas
【文件预览】:
drf-writable-nested-master
----.gitignore(134B)
----setup.cfg(66B)
----README.md(7KB)
----manage.py(843B)
----CHANGELOG.md(2KB)
----tests()
--------conftest.py(118B)
--------models.py(3KB)
--------migrations()
--------test_nested_validation.py(3KB)
--------settings.py(1KB)
--------test_writable_nested_model_serializer.py(34KB)
--------urls.py(165B)
--------utils.py(279B)
--------__init__.py(0B)
--------test_unique_fields_mixin.py(2KB)
--------serializers.py(8KB)
----mypy.ini(194B)
----drf_writable_nested()
--------mixins.py(16KB)
--------__init__.py(340B)
--------serializers.py(248B)
--------py.typed(0B)
----requirements.txt(85B)
----LICENSE.md(1KB)
----example()
--------README.md(56B)
--------models.py(636B)
--------settings.py(102B)
--------__init__.py(0B)
--------requirements.txt(25B)
--------serializers.py(1KB)
----MANIFEST.in(138B)
----setup.py(2KB)
----.travis.yml(689B)
----tox.ini(888B)

网友评论