but compare method checks if a < b. So it's not accurate comparision or
message, It should checks a <= b, isn't it?
The same for MinValueValidator
--
Ticket URL: <https://code.djangoproject.com/ticket/34503>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* easy: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/34503#comment:1>
* status: new => closed
* resolution: => invalid
Comment:
Sorry I think you may have misread the code.
Here is MaxValueValidator:
{{{
class MaxValueValidator(BaseValidator):
message = _("Ensure this value is less than or equal to
%(limit_value)s.")
code = "max_value"
def compare(self, a, b):
return a > b
}}}
Here a is the cleaned value while b is the limit. If compare is True then
a ValidationError is raised. The inverse of this comparison is therefore
correct: cleaned value must be less than or equal to the limit.
--
Ticket URL: <https://code.djangoproject.com/ticket/34503#comment:2>