Use form template
This commit is contained in:
parent
c5ac2d83c7
commit
11c215e4d8
6 changed files with 20 additions and 22 deletions
|
@ -13,11 +13,7 @@
|
|||
|
||||
<form action="{% url 'update_category' category.id %}" method="post">
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
{{ field.errors }}
|
||||
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% endfor %}
|
||||
{{ form }}
|
||||
<div class="buttons">
|
||||
<a href="{% url 'del_category' category.id %}"><input type="button" value="Delete" class="btn del" /></a>
|
||||
<input type="reset" />
|
||||
|
|
5
nummi/main/templates/main/form.html
Normal file
5
nummi/main/templates/main/form.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
{% for field in form %}
|
||||
{{ field.errors }}
|
||||
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% endfor %}
|
|
@ -23,11 +23,7 @@
|
|||
|
||||
<form action="{% url 'update_snapshot' snapshot.id %}" method="post">
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
{{ field.errors }}
|
||||
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% endfor %}
|
||||
{{ form }}
|
||||
<div class="buttons">
|
||||
<a href="{% url 'del_snapshot' snapshot.date %}"><input type="button" value="Delete" class="del" /></a>
|
||||
<input type="reset" />
|
||||
|
|
|
@ -12,11 +12,7 @@
|
|||
{% spaceless %}
|
||||
<form id="transaction" action="{% url 'update_transaction' transaction.id %}" method="post">
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
{{ field.errors }}
|
||||
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% endfor %}
|
||||
{{ form }}
|
||||
<div class="buttons">
|
||||
<a href="{% url 'del_transaction' transaction.id %}"><input type="button" value="Delete" class="btn del" /></a>
|
||||
<input class="btn" type="reset" />
|
||||
|
@ -41,11 +37,7 @@
|
|||
<h3>Add Invoice</h3>
|
||||
<form action="{% url 'add_invoice' transaction.id %}" method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{% for field in invoice_form %}
|
||||
{{ field.errors }}
|
||||
<label for="{{ field.id_for_label }}">{{field.label }}</label>
|
||||
{{ field }}
|
||||
{% endfor %}
|
||||
{{ invoice_form }}
|
||||
<div class="buttons"><input class="btn" type="submit" value="Add Invoice" /></div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue