#18724: Model field validation for IntegerFields does not validate 0 against
choices
----------------------------------------------+--------------------
Reporter: bremac | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.4
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
If a model has an {{{ IntegerField }}} with a limited set of choices, the
choices will not be checked if the model has the value zero. For instance,
given the following model:
{{{
class M(models.Model):
number = models.IntegerField(choices=((1, 1),))
}}}
{{{ M(number=2).full_clean() }}} will raise a {{{ ValidationError }}},
while {{{ M(number=0).full_clean() }}} will not.
--
Ticket URL: <https://code.djangoproject.com/ticket/18724>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.