Patient schreibgeschützt #29
This commit is contained in:
parent
af20e9ec16
commit
d779da75e7
2 changed files with 6 additions and 4 deletions
|
@ -11,8 +11,9 @@ class FallenBirdAdmin(admin.ModelAdmin):
|
||||||
"place",
|
"place",
|
||||||
"created",
|
"created",
|
||||||
"updated",
|
"updated",
|
||||||
"user"]
|
"user",
|
||||||
list_filter = ("bird", "created", "user")
|
"status"]
|
||||||
|
list_filter = ("bird", "created", "user", "status")
|
||||||
|
|
||||||
|
|
||||||
@admin.register(Bird)
|
@admin.register(Bird)
|
||||||
|
@ -22,7 +23,7 @@ class BirdAdmin(admin.ModelAdmin):
|
||||||
|
|
||||||
@admin.register(BirdStatus)
|
@admin.register(BirdStatus)
|
||||||
class BirdStatusAdmin(admin.ModelAdmin):
|
class BirdStatusAdmin(admin.ModelAdmin):
|
||||||
list_display = ["description"]
|
list_display = ["id", "description"]
|
||||||
|
|
||||||
|
|
||||||
@admin.register(Circumstance)
|
@admin.register(Circumstance)
|
||||||
|
|
|
@ -2,6 +2,7 @@ import names
|
||||||
from django.db.models import Sum
|
from django.db.models import Sum
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.shortcuts import HttpResponse, redirect, render
|
from django.shortcuts import HttpResponse, redirect, render
|
||||||
|
from django.db.models import Q
|
||||||
from rescuer.models import Rescuer
|
from rescuer.models import Rescuer
|
||||||
|
|
||||||
from .forms import BirdAddForm, BirdEditForm
|
from .forms import BirdAddForm, BirdEditForm
|
||||||
|
@ -43,7 +44,7 @@ def bird_help(request):
|
||||||
|
|
||||||
@login_required(login_url="account_login")
|
@login_required(login_url="account_login")
|
||||||
def bird_all(request):
|
def bird_all(request):
|
||||||
birds = FallenBird.objects.all().annotate(total_costs=Sum('costs__costs'))
|
birds = FallenBird.objects.filter(Q(status="1")|Q(status="2")).annotate(total_costs=Sum('costs__costs'))
|
||||||
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