【文件属性】:
文件名称:pydantic-django:对Django ORM的实验性Pydantic支持
文件大小:28KB
文件格式:ZIP
更新时间:2021-03-27 14:01:27
django django-orm pydantic Python
Pydantic-Django
ORM的模型接口。
重要提示:该项目应被视为实验性的进行中项目。 当前的API设计和行为尚未最终确定,并且尚未确定特定的版本支持。
安装
pip install pydantic-django
用法
要求:Python 3.7+,Django 2+
基本用法的示例:
class UserSchema ( ModelSchema ):
class Config :
model = User
UserSchema . schema ()
上面的模式调用将返回如下内容:
{
"title" : "UserSchema" ,
"description" : "A user of the application." ,
"type" : "object" ,
"properties
【文件预览】:
pydantic-django-main
----pydantic_django()
--------main.py(11KB)
--------py.typed(0B)
--------__init__.py(30B)
--------fields.py(4KB)
----pytest.ini(212B)
----.github()
--------workflows()
----tests()
--------test_relations.py(18KB)
--------test_queries.py(11KB)
--------conftest.py(0B)
--------test_schemas.py(9KB)
--------__init__.py(0B)
--------test_fields.py(3KB)
--------testapp()
--------test_main.py(1KB)
----LICENSE(1KB)
----setup.cfg(214B)
----requirements.txt(76B)
----setup.py(868B)
----.gitignore(2KB)
----README.md(4KB)
----scripts()
--------test(289B)
--------publish(580B)
--------README.md(266B)
--------setup(78B)