As simple and straight forward as my validator is, it is now not behaving as it should! It is intended to disallow any form entry of a value less than 10 but instead now it disallows every value entered into the field when the comparison operator is less than (>)! *VALIDATOR CODE:* class IS_NOT_LESS_THAN_TEN(object): def __init__(self, error_message="Enter an amount equivalent to P10.00 or more!"): #self.amount = amount self.error_message = error_message
def __call__(self, value): error = None if value>10: error = self.error_message return (value, error) *FIELD WHERE THE VALIDATOR IS USED:* db.define_table('my_token', ................. Field('Amount_You_Want_Saved', 'integer', label=SPAN('Amount You Want Saved'), requires=IS_NOT_LESS_THAN_TEN())) The problem i am facing now is that the validator disqualifies every value i enter even those greater than 10! When i change the comparison operator to greater than it accepts everything! If anyone sees the problem please point it out to me, thank you. Mostwanted On Sunday, November 25, 2018 at 9:51:18 AM UTC+2, mostwanted wrote: > > I ended up creating my custom validator, to handle this situation. > > On Friday, November 23, 2018 at 2:55:03 PM UTC+2, mostwanted wrote: >> >> How can I restrict a value entered into a database field to a certain >> desirable minimum? >> >> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.