Package orm2 :: Module validators :: Class range_validator
[hide private]
[frames] | no frames]

Class range_validator

source code

validator --+
            |
           range_validator

A generic validator for value ranges (fortunately Python doesn't care, it can be used for numerals, dates, strings...)

Instance Methods [hide private]
  __init__(self, lo, hi, include_bounds=False)
The formula goes:
  check(self, dbobj, dbproperty, value)

Method Details [hide private]

__init__(self, lo, hi, include_bounds=False)
(Constructor)

source code 
The formula goes:
  lo < value < hi
if include_bounds is False (the default) or:
  lo <= value <= hi
otherwise. If above formula is not valid, a RangeValidatorError will be raised by check()

check(self, dbobj, dbproperty, value)

source code 
None
Overrides: validator.check