You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classDecimal(RangeValidator):
"""Convert a value to an integer. Example:: >>> Decimal.to_python('10') 10 >>> Decimal.to_python('ten') Traceback (most recent call last): ... Invalid: Please enter an integer value >>> Int(min=5).to_python('6') 6 >>> Int(max=10).to_python('11') Traceback (most recent call last): ... Invalid: Please enter a number that is 10 or smaller """messages=dict(
decimal=_('Please enter a decimal value'))
def_convert_to_python(self, value, state):
try:
returndecimal.Decimal(value)
except (ValueError, TypeError):
raiseInvalid(self.message('decimal', state), value, state)
_convert_from_python=_convert_to_python
The text was updated successfully, but these errors were encountered:
Needs some work on docstring basically:
The text was updated successfully, but these errors were encountered: