本文整理匯總了Python中wtforms.fields.IntegerField方法的典型用法代碼示例。如果您正苦於以下問題:Python fields.IntegerField方法的具體用法?Python fields.IntegerField怎麽用?Python fields.IntegerField使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類wtforms.fields
的用法示例。
在下文中一共展示了fields.IntegerField方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: handle_integer_types
# 需要導入模塊: from wtforms import fields [as 別名]
# 或者: from wtforms.fields import IntegerField [as 別名]
def handle_integer_types(self, column, field_args, **extra):
unsigned = getattr(column.type, 'unsigned', False)
if unsigned:
field_args['validators'].append(validators.NumberRange(min=0))
return f.IntegerField(**field_args)
示例2: get_IntegerField
# 需要導入模塊: from wtforms import fields [as 別名]
# 或者: from wtforms.fields import IntegerField [as 別名]
def get_IntegerField(kwargs):
"""
Returns an ``IntegerField``, applying the ``ndb.IntegerProperty`` range
limits.
"""
v = validators.NumberRange(min=-0x8000000000000000, max=0x7fffffffffffffff)
kwargs['validators'].append(v)
return f.IntegerField(**kwargs)
示例3: get_IntegerField
# 需要導入模塊: from wtforms import fields [as 別名]
# 或者: from wtforms.fields import IntegerField [as 別名]
def get_IntegerField(kwargs):
"""
Returns an ``IntegerField``, applying the ``db.IntegerProperty`` range
limits.
"""
v = validators.NumberRange(min=-0x8000000000000000, max=0x7fffffffffffffff)
kwargs['validators'].append(v)
return f.IntegerField(**kwargs)
示例4: convert_RatingProperty
# 需要導入模塊: from wtforms import fields [as 別名]
# 或者: from wtforms.fields import IntegerField [as 別名]
def convert_RatingProperty(model, prop, kwargs):
"""Returns a form field for a ``db.RatingProperty``."""
kwargs['validators'].append(validators.NumberRange(min=0, max=100))
return f.IntegerField(**kwargs)