【文件属性】:
文件名称:django-rf-candv-choices:django-candv-choices对django-rest-framework的支持
文件大小:9KB
文件格式:ZIP
更新时间:2021-05-18 18:08:29
Python
django-rf-candv-choices
将与。
目录
安装
从安装:
$ pip install django-rf-candv-choices
用法
序列化选择
例如,您有一些使用candv_x.django.choices.ChoiceField模型来存储允许值之一。 这可能是一个User模型,它具有user_role字段,其中user_role值由USER_ROLES常量容器定义。
使用candv_x.rest_framework.choices.ChoiceField进行user_role序列化:
from rest_framework import serializers
from candv_x . rest_framework . choices import ChoiceField
from . constants import USER_ROLES
【文件预览】:
django-rf-candv-choices-master
----MANIFEST.in(60B)
----README.rst(3KB)
----LICENSE(7KB)
----candv_x()
--------__init__.py(200B)
--------rest_framework()
----requirements.txt(277B)
----setup.py(1KB)
----.gitignore(544B)