I am using CreateView in django and rendering my components with tweak widget would like to know if there is any way to swap this first combo option
rendered form in the template
{% render_field form.category class="form-control" %}
You can use initial
, see:
>>> import datetime
>>> class DateForm(forms.Form):
... day = forms.DateField(initial=datetime.date.today)
Or so for a text:
>>> class CommentForm(forms.Form):
... name = forms.CharField()
... url = forms.URLField()
... comment = forms.CharField()
>>> default_data = {'name': 'Your name', 'url': 'http://'}
>>> f = CommentForm(default_data, auto_id=False)