Skip to main content

快速构建 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


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.4.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dseagull-0.0.4-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file dseagull-0.0.4.tar.gz.

File metadata

  • Download URL: dseagull-0.0.4.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for dseagull-0.0.4.tar.gz
Algorithm Hash digest
SHA256 29a4ba2032ce223bb3495a7a701933e23131002a48583184e1cb8dc222ca98be
MD5 001375977f9e10ebbddb90dd2eda9bec
BLAKE2b-256 d5c355ca78d04218fe35c9f4972cfce7ebb87ac86d27596de041c63d40117aea

See more details on using hashes here.

File details

Details for the file dseagull-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: dseagull-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for dseagull-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8c16c42dd23c9cbea6773b52cb78df416f6b8e3de05488fdbc7a083e6af437c3
MD5 ea390589797cfa7f266e1ffc60d606ee
BLAKE2b-256 6e14c195e2d85b54849ae451c848a6f2541cdce87e5452a5cec7d834dc397dff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page