[web2py] IS_INT_IN_RANGE() weirdness

2014-09-09 Thread Joe Barnhart
Did anyone notice that the range for the INT validator is min = value max, while the validator for FLOAT is min = value = max? Since the max value is not actually in the range of the INT validator, it means you can't do this: IS_INT_IN_RANGE(1,1) The above will fail every time, for all time.

[web2py] IS_INT_IN_RANGE error message

2013-04-26 Thread Alex
If I pass minimum/maximum to the validator then the error_message gets translated, otherwise it uses the original error_message. db.mytable.myfield.requires = IS_INT_IN_RANGE(1, error_message='The field must contain a number') but without min/max I have to use T(...): db.mytable.myfield.requires

[web2py] IS_INT_IN_RANGE Behavior in Database Example

2011-03-23 Thread Jaunx
In Example 29 of the Database Examples of the Quick Examples tutorial, the last line of the model definition file (db.py) puts the following constraint on the purchases.quantity field: db.purchases.quantity.requires=IS_INT_IN_RANGE(0,10) In Example 33, the controller for the purchase form

Re: [web2py] IS_INT_IN_RANGE Behavior in Database Example

2011-03-23 Thread David J.
I suppose to override; The example you gave would be pointless to have both; Clearly if you define it once at the model; then again in the controller; shouldn't the one define in the controller take precedence; How else would you override? On 3/23/11 11:45 AM, Jaunx wrote: In Example 29

[web2py] IS_INT_IN_RANGE

2010-04-22 Thread dave
When using validator IS_INT_IN_RANGE(1900,2100) and a value of 2100 is entered an error message of 'enter an integer between 1900 and 2099' is displayed. A value of 1900 is accepted. Seams like the range of the validator should be inclusive for BOTH ends. I have not

Re: [web2py] IS_INT_IN_RANGE

2010-04-22 Thread Jonathan Lundell
On Apr 22, 2010, at 4:28 PM, dave wrote: When using validator IS_INT_IN_RANGE(1900,2100) and a value of 2100 is entered an error message of 'enter an integer between 1900 and 2099' is displayed. A value of 1900 is accepted. It's using the Python notion of a range,