本文整理汇总了Python中wtforms.fields.TextField方法的典型用法代码示例。如果您正苦于以下问题:Python fields.TextField方法的具体用法?Python fields.TextField怎么用?Python fields.TextField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wtforms.fields
的用法示例。
在下文中一共展示了fields.TextField方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: conv_String
# 需要导入模块: from wtforms import fields [as 别名]
# 或者: from wtforms.fields import TextField [as 别名]
def conv_String(self, field_args, **extra):
self._string_common(field_args=field_args, **extra)
return f.TextField(**field_args)
示例2: conv_MSYear
# 需要导入模块: from wtforms import fields [as 别名]
# 或者: from wtforms.fields import TextField [as 别名]
def conv_MSYear(self, field_args, **extra):
field_args['validators'].append(validators.NumberRange(min=1901, max=2155))
return f.TextField(**field_args)
示例3: conv_PGInet
# 需要导入模块: from wtforms import fields [as 别名]
# 或者: from wtforms.fields import TextField [as 别名]
def conv_PGInet(self, field_args, **extra):
field_args.setdefault('label', 'IP Address')
field_args['validators'].append(validators.IPAddress())
return f.TextField(**field_args)
示例4: conv_PGMacaddr
# 需要导入模块: from wtforms import fields [as 别名]
# 或者: from wtforms.fields import TextField [as 别名]
def conv_PGMacaddr(self, field_args, **extra):
field_args.setdefault('label', 'MAC Address')
field_args['validators'].append(validators.MacAddress())
return f.TextField(**field_args)
示例5: conv_PGUuid
# 需要导入模块: from wtforms import fields [as 别名]
# 或者: from wtforms.fields import TextField [as 别名]
def conv_PGUuid(self, field_args, **extra):
field_args.setdefault('label', 'UUID')
field_args['validators'].append(validators.UUID())
return f.TextField(**field_args)
示例6: conv_IPAddressField
# 需要导入模块: from wtforms import fields [as 别名]
# 或者: from wtforms.fields import TextField [as 别名]
def conv_IPAddressField(self, model, field, kwargs):
kwargs['validators'].append(validators.ip_address())
return f.TextField(**kwargs)
示例7: conv_URLField
# 需要导入模块: from wtforms import fields [as 别名]
# 或者: from wtforms.fields import TextField [as 别名]
def conv_URLField(self, model, field, kwargs):
kwargs['validators'].append(validators.url())
return f.TextField(**kwargs)
示例8: get_TextField
# 需要导入模块: from wtforms import fields [as 别名]
# 或者: from wtforms.fields import TextField [as 别名]
def get_TextField(kwargs):
"""
Returns a ``TextField``, applying the ``ndb.StringProperty`` length limit
of 500 bytes.
"""
kwargs['validators'].append(validators.length(max=500))
return f.TextField(**kwargs)
示例9: get_TextField
# 需要导入模块: from wtforms import fields [as 别名]
# 或者: from wtforms.fields import TextField [as 别名]
def get_TextField(kwargs):
"""
Returns a ``TextField``, applying the ``db.StringProperty`` length limit
of 500 bytes.
"""
kwargs['validators'].append(validators.length(max=500))
return f.TextField(**kwargs)