Answer the question
In order to leave comments, you need to log in
How to check form field value for specific values?
Good afternoon!
I check in forms.py the validity of the values entered by the user.
class chooses_log(forms.Form):
channel = forms.CharField(required=True, min_length=3, max_length=10)
date = forms.DateField(input_formats=['%Y/%m/%d'])
page = forms.IntegerField(required=True, min_value=1, max_value=1000)
Answer the question
In order to leave comments, you need to log in
return channel if channel in ['support', 'second', 'third'] else False
?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question