forms.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:railgun 作者: xin-xinhanggao 项目源码 文件源码
def validate_timezone(form, field):
        """Validate whether the user provided timezone is a valid timezone.
        Lists of valid timezones can be found on `Wikipedia
        <http://en.wikipedia.org/wiki/List_of_tz_database_time_zones>`_
        """
        try:
            timezone(field.data)
        except UnknownTimeZoneError:
            raise ValidationError(_("Please enter a valid timezone."))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号