Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class YourForm(forms.Form):
- your_field = forms.BooleanField(initial=True)
- class MyForm(forms.Form):
- your_field = forms.BooleanField()
- def __init__(self, *args, **kwargs):
- super(MyForm, self).__init__(*args, **kwargs)
- self.fields['your_field'].initial = True
- form = MyForm(initial={'your_field': True})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement