Simplify DB object management with Django CRUD helpers

This commit is contained in:
2022-10-29 12:43:13 +01:00
parent 8f705e2f25
commit c685b6d25f
26 changed files with 435 additions and 936 deletions

View File

@@ -13,7 +13,7 @@
<th>TL</th>
<th>actions</th>
</thead>
{% for item in items %}
{% for item in object_list %}
<tr>
<td>{{ item.id }}</td>
<td>{{ item.status }}</td>
@@ -28,7 +28,7 @@
<div class="buttons">
<button
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-get="{% url 'trade_action' type=type trade_id=item.id %}"
hx-get="{% url 'trade_update' type=type pk=item.id %}"
hx-trigger="click"
hx-target="#{{ type }}s-here"
class="button is-info">
@@ -40,9 +40,9 @@
</button>
<button
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-delete="{% url 'trade_action' type=type trade_id=item.id %}"
hx-delete="{% url 'trade_delete' type=type pk=item.id %}"
hx-trigger="click"
hx-target="#trades-table"
hx-target="#modals-here"
class="button is-danger">
<span class="icon-text">
<span class="icon">