Select now store selections between forms.Partial: #362

This commit is contained in:
Matthew Smith
2019-10-16 20:06:08 +01:00
parent 3de58740c6
commit 3079ee0814
4 changed files with 7 additions and 42 deletions

View File

@@ -8,15 +8,7 @@
{% if create or edit or duplicate %}
<div class="form-group">
<label for="{{ form.purchased_from.id_for_label }}">Purchased From</label>
<select class="form-control" name="{{ form.purchased_from.name }}" id="{{ form.purchased_from.id_for_label }}">
{% for id, choice in form.purchased_from.field.choices %}
<option value="{{ id }}"
{% if object.purchased_from.id == id %}
selected
{% endif %}>
{{ choice }}</option>
{% endfor %}
</select>
{% render_field form.purchased_from|add_class:"form-control" %}
</div>
<div class="form-group">