快速构建 RESTful API
Project description
Dseagull
快速构建 RESTful API
serializers.Field
支持 required=True 时提示带上字段的 help_text 信息
from rest_framework.serializers import Serializer
class ExampleSerializer(Serializer):
name = field(help_text='姓名')
ExampleSerializer(data={}).is_valid()
原本提示:这个字段是必填项。
现提示:姓名:这个字段是必填项。
支持 required=True, null=False 时提示带上字段的 help_text 信息
from rest_framework.serializers import Serializer
class ExampleSerializer(Serializer):
name = field(help_text='姓名')
ExampleSerializer(data={'name': None}).is_valid()
原本提示:This field may not be null. 现提示:姓名:不能为空。
支持 required=True, null=False 时提示带上字段的 help_text 信息
from rest_framework.serializers import Serializer
class ExampleSerializer(Serializer):
name = field(help_text='姓名')
ExampleSerializer(data={'name': ''}).is_valid()
原本提示:This field may not be blank. 现提示:姓名:不能为空白。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dseagull-0.0.3.tar.gz
(3.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dseagull-0.0.3.tar.gz.
File metadata
- Download URL: dseagull-0.0.3.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77f23fee15c78985614c6785d07ec3b52a469f9e7bdfda482f52c65c99c4aef9
|
|
| MD5 |
f9b430cdef04bd846de3a609342b58bc
|
|
| BLAKE2b-256 |
8efe44e6bc8db4b73fed304d96f5255469c0a93cf26d03c609f22a527e8535cd
|
File details
Details for the file dseagull-0.0.3-py3-none-any.whl.
File metadata
- Download URL: dseagull-0.0.3-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f951e81a4713aeaf53b5c8789323c2e3353e41356c643ccbf21000f81d251de4
|
|
| MD5 |
d912b3ac379dc580060f831d1cc4f994
|
|
| BLAKE2b-256 |
d5675cefbe9b49c39ebfb50e244ee807d07cf8ab56af3e28e5122989379fd648
|