I made the following Django form.
from django.core.validators import int_list_validator
class RoomForm(forms. Form):
room_numbers = forms.CharField(validators=[int_list_validator], required=False, max_length=4000)
In this form even if I submit a string like 'hello' the form gets submitted. I mean I can get the value 'hello' in views.py. I don't understand why because "int_list_validator" should not allow it.
Unfortunate naming:
int_list_validatoris not a validator but a helper function that creates one.validate_comma_separated_integer_listis a validator, created by callingint_list_validatorwith a more suitable message than the default_("Enter a valid value."):Usage: