order in view and use a counter in the template
This commit is contained in:
parent
8660d1c7ba
commit
473a21cad0
2 changed files with 3 additions and 5 deletions
|
@ -71,10 +71,8 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{% url 'bird_single' bird.id %}">{{ bird.bird_identifier }}</a></td>
|
<td><a href="{% url 'bird_single' bird.id %}">{{ bird.bird_identifier }}</a></td>
|
||||||
<td>{{ bird.bird }}</td>
|
<td>{{ bird.bird }}</td>
|
||||||
<td>{{ bird.date_found }}</td>
|
<td data-order="{{ forloop.counter }}">{{ bird.date_found }}</td>
|
||||||
<td>
|
<td><a href="{% url 'rescuer_single' bird.rescuer_id %}">{{ bird.rescuer|default_if_none:"" }}</a></td>
|
||||||
<a href="{% url 'rescuer_single' bird.rescuer_id %}">{{ bird.rescuer|default_if_none:"" }}</a>
|
|
||||||
</td>
|
|
||||||
<td>{{ bird.place }}</td>
|
<td>{{ bird.place }}</td>
|
||||||
<td>{{ bird.status }}</td>
|
<td>{{ bird.status }}</td>
|
||||||
<td>{{ bird.aviary|default_if_none:"" }}</td>
|
<td>{{ bird.aviary|default_if_none:"" }}</td>
|
||||||
|
|
|
@ -52,7 +52,7 @@ def bird_help_single(request, id):
|
||||||
def bird_all(request):
|
def bird_all(request):
|
||||||
birds = FallenBird.objects.filter(Q(status="1") | Q(status="2")).annotate(
|
birds = FallenBird.objects.filter(Q(status="1") | Q(status="2")).annotate(
|
||||||
total_costs=Sum("costs__costs")
|
total_costs=Sum("costs__costs")
|
||||||
)
|
).order_by("date_found")
|
||||||
rescuer_modal = Rescuer.objects.all()
|
rescuer_modal = Rescuer.objects.all()
|
||||||
context = {"birds": birds, "rescuer_modal": rescuer_modal}
|
context = {"birds": birds, "rescuer_modal": rescuer_modal}
|
||||||
# Post came from the modal form.
|
# Post came from the modal form.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue