Fehlerhafte Sortierung bei "Gefunden Am"

Fixes #45
This commit is contained in:
gw3000 2023-08-13 22:22:03 +02:00
parent 473a21cad0
commit 6387e45434
4 changed files with 19 additions and 18 deletions

View file

@ -18,7 +18,7 @@
<script src="https://cdn.datatables.net/responsive/2.2.9/js/responsive.bootstrap5.min.js"></script>
<!-- Configure the DataTable. -->
<script nonce="{{request.csp_nonce}}">
<script nonce="{{ request.csp_nonce }}">
$(document).ready(function () {
let table = $('#t__costs_all').DataTable({
language: {
@ -64,11 +64,11 @@
<tbody>
{% for item in costs %}
<tr>
<td> {{item.id_bird|default_if_none:"nicht mehr in WVH"}} </td>
<td> {{item.costs}} &euro;</td>
<td> {{item.created}} </td>
<td> {{item.comment|default_if_none:""}} </td>
<td> {{item.user}} </td>
<td> {{ item.id_bird|default_if_none:"nicht mehr in WVH" }} </td>
<td> {{ item.costs }} &euro;</td>
<td data-order="{{ forloop.counter }}"> {{ item.created }} </td>
<td> {{ item.comment|default_if_none:"" }} </td>
<td> {{ item.user }} </td>
<td><a href="{% url 'costs_edit' item.id %}"><i class="fa-sharp fa-solid fa-pen"></i></a></td>
<td><a href="{% url 'costs_delete' item.id %}"><i class="fa-sharp fa-solid fa-trash"></i></a></td>
</tr>

View file

@ -7,7 +7,7 @@ from .models import Costs
@login_required(login_url="account_login")
def costs_all(request):
costs = Costs.objects.all()
costs = Costs.objects.all().order_by("created")
context = {"costs": costs}
return render(request, "costs/costs_all.html", context)