sorted imports
This commit is contained in:
parent
c108965792
commit
51e824f879
6 changed files with 21 additions and 11 deletions
|
@ -5,7 +5,13 @@ from .models import Bird, FallenBird
|
|||
|
||||
@admin.register(FallenBird)
|
||||
class ContractAdmin(admin.ModelAdmin):
|
||||
list_display = ["bird", "date_found", "place", "created", "updated", "user"]
|
||||
list_display = [
|
||||
"bird",
|
||||
"date_found",
|
||||
"place",
|
||||
"created",
|
||||
"updated",
|
||||
"user"]
|
||||
list_filter = ("bird", "created", "user")
|
||||
|
||||
|
||||
|
|
|
@ -12,8 +12,9 @@ class FallenBird(models.Model):
|
|||
created = models.DateTimeField(auto_now_add=True)
|
||||
updated = models.DateTimeField(auto_now=True)
|
||||
rescuer = models.ForeignKey(Rescuer, on_delete=models.CASCADE)
|
||||
|
||||
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
|
||||
user = models.ForeignKey(
|
||||
settings.AUTH_USER_MODEL,
|
||||
on_delete=models.CASCADE)
|
||||
|
||||
def __str__(self):
|
||||
return self.place
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th>Vogel</th>
|
||||
<th>Finder</th>
|
||||
<th>Retter</th>
|
||||
<th>Fundort</th>
|
||||
<th>gefunden am</th>
|
||||
</tr>
|
||||
|
@ -70,4 +70,4 @@
|
|||
</div>
|
||||
</form>
|
||||
|
||||
{% endblock content %}
|
||||
{% endblock content %}
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
from django.urls import path
|
||||
|
||||
from .views import (
|
||||
bird_create,
|
||||
bird_all,
|
||||
bird_single,
|
||||
bird_create,
|
||||
bird_delete,
|
||||
bird_recover,
|
||||
bird_recover_all,
|
||||
bird_single,
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
path("all/", bird_all, name="bird_all"),
|
||||
path("create/", bird_create, name="bird_create"),
|
||||
path("delete/<id>", bird_delete, name="bird_delete"),
|
||||
path("recover/all", bird_recover_all, name="bird_recover_all"),
|
||||
path("recover/<id>", bird_recover, name="bird_recover"),
|
||||
path("all/", bird_all, name="bird_all"),
|
||||
path("recover/all", bird_recover_all, name="bird_recover_all"),
|
||||
path("<id>/", bird_single, name="bird_single"),
|
||||
]
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
from django.contrib.auth.decorators import login_required
|
||||
from django.shortcuts import HttpResponse, redirect, render
|
||||
|
||||
from rescuer.models import Rescuer
|
||||
|
||||
from .forms import BirdForm
|
||||
from .models import FallenBird
|
||||
from rescuer.models import Rescuer
|
||||
|
||||
|
||||
@login_required(login_url="account_login")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue