Re: MaxValueValidator to validate a model

2010-10-18 Thread Steve Holden
On 10/15/2010 9:18 PM, refreegrata wrote: > Now works. > validators=[MaxValueValidator(Decimal('14.5')) > > But I must to do an explicit declaration Decimal('14.5'). > > Somebody knows why? Because only decimal numbers can give exact comparisons to arbitrary decimal values. You would not want

Re: MaxValueValidator to validate a model

2010-10-15 Thread refreegrata
Now works. validators=[MaxValueValidator(Decimal('14.5')) But I must to do an explicit declaration Decimal('14.5'). Somebody knows why? On 15 oct, 18:13, refreegrata wrote: > Hello list. I want to validate the data in a field of a model. > > with this >

MaxValueValidator to validate a model

2010-10-15 Thread refreegrata
Hello list. I want to validate the data in a field of a model. with this validators=[MaxValueValidator(14)] the field is correctly validated but with this validators=[MaxValueValidator(14.5)] always is invalid Somebody know how use the "MaxValueValidator" when the "max_value" is a decimal?