#35445: Adding model field validators to FloatField and IntegerField is not
possible.
------------------------------+----------------------------------------
Reporter: AjmalPonneth | Owner: AjmalPonneth
Type: Bug | Status: closed
Component: Core (Other) | Version: 5.0
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+----------------------------------------
Changes (by Sarah Boyce):
* component: Database layer (models, ORM) => Core (Other)
* resolution: => invalid
* status: assigned => closed
Comment:
Hi AjmalPonneth,
MinLengthValidator and MaxLengthValidator are not meant to be used for
floats as it is checking the length. You may want to use MinValueValidator
and MaxValueValidator.
If you want to make some tweaks to the docs around which types the
validators can be used for, feel free 👍
--
Ticket URL: <
https://code.djangoproject.com/ticket/35445#comment:1>