0๐
โ
You need to include field errors when you manually render the form in the template.
<div class="span1">
{{ wo_form.subject.errors }}
<label for="wo_form.complete.label" class="checkbox">
<input type="checkbox"> {{ wo_form.complete.label }}
</label>
</div>
For more information, see the docs on customizing the form template. Since you are using bootstrap, you may find crispy forms useful. It makes it easy to render forms that look good with bootstrap.
๐คAlasdair
1๐
Form creation:
wo_form = WorkOrderForm(prefix="wo")
store_form = StoreForm(prefix="store")
In template use one tag to post two forms in one time, and then in view:
if request.method == 'POST':
store_form = StoreForm(request.POST, prefix="store")
wo_form = WorkOrderForm(request.POST, prefix="wo")
if 'store_form' in request.POST:
if store_form.is_valid():
store_form.save()
elif wo_form.is_valid():
wo_form.save()
....
๐คdswistowski
- [Answer]-How Do I Fetch Article that has #exam and NOT #example in Django?
- [Answer]-How to moderate django_openid_auth
- [Answer]-Display image as property of a ChoiceField in a form
- [Answer]-Defining Label on a Model
- [Answer]-How to store registration value in to database?
Source:stackexchange.com