Hi everyone,

Given a field in a model that uses choices:

CHOICES = (
    (0, "choice_0"),
    (1, "choice_1")
)

foo = models.IntegerField(choices=CHOICES)


If i put a value other than 0 or 1, django will accept it. Is that possible 
that we instruct Django to accept only values that are mentioned in CHOICES 
without creating a validator function.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/78d84aa0-506f-4d5c-9590-ef6325c255e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to