【问题标题】:_("str") in Python , meaning of both [duplicate]_("str") 在 Python 中,两者的含义 [重复]
【发布时间】:2020-01-05 06:21:36
【问题描述】:

我是python的初学者。现在我正在做一个 Django 项目。 我看到很多代码行包含_('password')_('last_login') 等。 检查下面的代码:


    username = models.CharField(
        _('username'),
        max_length=150,
        unique=True,
        help_text=_('Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.'),
        validators=[username_validator],
        error_messages={
            'unique': _("A user with that username already exists."),
        },
    )

_('username')有什么用?

【问题讨论】:

    标签: python django


    【解决方案1】:
    猜你喜欢
    • 2016-07-16
    • 2015-01-13
    • 1970-01-01
    • 2016-09-23
    • 1970-01-01
    • 2021-04-04
    • 2013-10-20
    • 2019-09-12
    • 2020-10-23
    相关资源
    最近更新 更多