本文整理匯總了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)