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
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
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 of
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 (fo
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, f
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 check
6 matches
Mail list logo