show only costs from active birds
This commit is contained in:
parent
12c6d762e2
commit
50d1ea1953
2 changed files with 4 additions and 2 deletions
|
@ -60,7 +60,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for item in costs %}
|
{% for item in costs %}
|
||||||
<tr>
|
<tr>
|
||||||
<td> {{item.id_bird}} </td>
|
<td> {{item.id_bird|default_if_none:"nicht mehr in WVH"}} </td>
|
||||||
<td> {{item.costs}} </td>
|
<td> {{item.costs}} </td>
|
||||||
<td> {{item.created}} </td>
|
<td> {{item.created}} </td>
|
||||||
<td> {{item.comment|default_if_none:""}} </td>
|
<td> {{item.comment|default_if_none:""}} </td>
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.shortcuts import render, redirect
|
from django.shortcuts import render, redirect
|
||||||
|
from django.db.models import Q
|
||||||
|
|
||||||
|
|
||||||
from .forms import RescuerForm
|
from .forms import RescuerForm
|
||||||
from .models import Rescuer
|
from .models import Rescuer
|
||||||
|
@ -16,7 +18,7 @@ def rescuer_all(request):
|
||||||
@login_required(login_url="account_login")
|
@login_required(login_url="account_login")
|
||||||
def rescuer_single(request, id):
|
def rescuer_single(request, id):
|
||||||
rescuer = Rescuer.objects.get(id=id)
|
rescuer = Rescuer.objects.get(id=id)
|
||||||
birds = FallenBird.objects.filter(rescuer=id)
|
birds = FallenBird.objects.filter(rescuer=id).filter(Q(status="1") | Q(status="2"))
|
||||||
context = {"rescuer": rescuer, "birds": birds}
|
context = {"rescuer": rescuer, "birds": birds}
|
||||||
return render(request, "rescuer/rescuer_single.html", context)
|
return render(request, "rescuer/rescuer_single.html", context)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue