I have a simple form that looks like this:
class SettingsForm(forms.ModelForm):
theme = forms.CharField(required=True, initial='yellow')
defaultinputmessage = forms.CharField(required=True, initial='Type here')
I can iterate over the form fields by doing this:
for field in SettingsForm().fields:
print field
Is there a way I could access the default values for each of the form fields as well?
Thanks.
1 Answer