I've got a profile model with some nullable fields in order to create it easily, however, I'd like users to fill in all the form fields even if they are nullable when they try to edit it. Feel free to let me know if you need more info... Thanks!!
Asked
Active
Viewed 73 times
1 Answers
1
Add required=True
to all your form fields manually
from django import forms
class YourForm(forms.Form):
your_filed = forms.CharField(required=True)
...
or make it with __init__
from django import forms
class YourForm(forms.Form):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
for key in self.fields:
self.fields[key].required = True

weAreStarsDust
- 2,634
- 3
- 10
- 22