Age of Bird
This commit is contained in:
parent
6ca3eaefa8
commit
fbaef27c3a
6 changed files with 32 additions and 23 deletions
|
@ -7,6 +7,7 @@ from .models import Bird, FallenBird, BirdStatus, Circumstance
|
||||||
class FallenBirdAdmin(admin.ModelAdmin):
|
class FallenBirdAdmin(admin.ModelAdmin):
|
||||||
list_display = [
|
list_display = [
|
||||||
"bird",
|
"bird",
|
||||||
|
"age",
|
||||||
"date_found",
|
"date_found",
|
||||||
"place",
|
"place",
|
||||||
"created",
|
"created",
|
||||||
|
|
|
@ -22,6 +22,7 @@ class BirdAddForm(forms.ModelForm):
|
||||||
fields = [
|
fields = [
|
||||||
"bird_identifier",
|
"bird_identifier",
|
||||||
"bird",
|
"bird",
|
||||||
|
"age",
|
||||||
"date_found",
|
"date_found",
|
||||||
"place",
|
"place",
|
||||||
"find_circumstances",
|
"find_circumstances",
|
||||||
|
@ -30,6 +31,7 @@ class BirdAddForm(forms.ModelForm):
|
||||||
labels = {
|
labels = {
|
||||||
"bird_identifier": _("Kennung"),
|
"bird_identifier": _("Kennung"),
|
||||||
"bird": _("Vogel"),
|
"bird": _("Vogel"),
|
||||||
|
"age": _("Alter"),
|
||||||
"date_found": _("Datum des Fundes"),
|
"date_found": _("Datum des Fundes"),
|
||||||
"place": _("Fundort"),
|
"place": _("Fundort"),
|
||||||
"find_circumstances": _("Fundumstände"),
|
"find_circumstances": _("Fundumstände"),
|
||||||
|
|
|
@ -10,27 +10,36 @@ from aviary.models import Aviary
|
||||||
from rescuer.models import Rescuer
|
from rescuer.models import Rescuer
|
||||||
|
|
||||||
|
|
||||||
|
CHOICE_AGE = [
|
||||||
|
("Ei", "Ei"),
|
||||||
|
("Nestling", "Nestling"),
|
||||||
|
("Ästling", "Ästling"),
|
||||||
|
("Adult", "Adult"),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def costs_default():
|
def costs_default():
|
||||||
return [{"date": date.today().strftime("%Y-%m-%d"), "cost_entry": "0.00"}]
|
return [{"date": date.today().strftime("%Y-%m-%d"), "cost_entry": "0.00"}]
|
||||||
|
|
||||||
|
|
||||||
class FallenBird(models.Model):
|
class FallenBird(models.Model):
|
||||||
id = models.UUIDField(primary_key=True, default=uuid4, editable=False)
|
id = models.UUIDField(primary_key=True, default=uuid4, editable=False)
|
||||||
bird_identifier = models.CharField(
|
bird_identifier = models.CharField(max_length=256, verbose_name=_("Kennung"))
|
||||||
max_length=256, verbose_name=_("Kennung"))
|
|
||||||
bird = models.ForeignKey(
|
bird = models.ForeignKey(
|
||||||
"Bird", on_delete=models.CASCADE, verbose_name=_("Patient")
|
"Bird", on_delete=models.CASCADE, verbose_name=_("Patient")
|
||||||
)
|
)
|
||||||
|
age = models.CharField(
|
||||||
|
max_length=15,
|
||||||
|
choices=CHOICE_AGE,
|
||||||
|
verbose_name=_("Alter")
|
||||||
|
)
|
||||||
date_found = models.DateField(verbose_name=_("Datum des Fundes"))
|
date_found = models.DateField(verbose_name=_("Datum des Fundes"))
|
||||||
place = models.CharField(max_length=256, verbose_name=_("Ort des Fundes"))
|
place = models.CharField(max_length=256, verbose_name=_("Ort des Fundes"))
|
||||||
created = models.DateTimeField(
|
created = models.DateTimeField(auto_now_add=True, verbose_name=_("angelegt am"))
|
||||||
auto_now_add=True,
|
updated = models.DateTimeField(auto_now=True, verbose_name=_("geändert am"))
|
||||||
verbose_name=_("angelegt am"))
|
|
||||||
updated = models.DateTimeField(
|
|
||||||
auto_now=True, verbose_name=_("geändert am"))
|
|
||||||
find_circumstances = models.ForeignKey(
|
find_circumstances = models.ForeignKey(
|
||||||
"Circumstance", on_delete=models.CASCADE,
|
"Circumstance", on_delete=models.CASCADE, verbose_name=_("Fundumstände")
|
||||||
verbose_name=_("Fundumstände"))
|
)
|
||||||
diagnostic_finding = models.CharField(
|
diagnostic_finding = models.CharField(
|
||||||
max_length=256, verbose_name=_("Diagnose bei Fund")
|
max_length=256, verbose_name=_("Diagnose bei Fund")
|
||||||
)
|
)
|
||||||
|
@ -42,13 +51,9 @@ class FallenBird(models.Model):
|
||||||
verbose_name=_("Finder"),
|
verbose_name=_("Finder"),
|
||||||
)
|
)
|
||||||
user = models.ForeignKey(
|
user = models.ForeignKey(
|
||||||
settings.AUTH_USER_MODEL,
|
settings.AUTH_USER_MODEL, on_delete=models.CASCADE, verbose_name=_("Benutzer")
|
||||||
on_delete=models.CASCADE,
|
)
|
||||||
verbose_name=_("Benutzer"))
|
status = models.ForeignKey("BirdStatus", on_delete=models.CASCADE, default=1)
|
||||||
status = models.ForeignKey(
|
|
||||||
"BirdStatus",
|
|
||||||
on_delete=models.CASCADE,
|
|
||||||
default=1)
|
|
||||||
aviary = models.ForeignKey(
|
aviary = models.ForeignKey(
|
||||||
Aviary,
|
Aviary,
|
||||||
on_delete=models.SET_NULL,
|
on_delete=models.SET_NULL,
|
||||||
|
@ -70,10 +75,7 @@ class FallenBird(models.Model):
|
||||||
|
|
||||||
class Bird(models.Model):
|
class Bird(models.Model):
|
||||||
id = models.BigAutoField(primary_key=True)
|
id = models.BigAutoField(primary_key=True)
|
||||||
name = models.CharField(
|
name = models.CharField(max_length=256, unique=True, verbose_name=_("Bezeichnung"))
|
||||||
max_length=256,
|
|
||||||
unique=True,
|
|
||||||
verbose_name=_("Bezeichnung"))
|
|
||||||
description = RichTextField(blank=True, null=True)
|
description = RichTextField(blank=True, null=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -100,8 +102,7 @@ class BirdStatus(models.Model):
|
||||||
|
|
||||||
class Circumstance(models.Model):
|
class Circumstance(models.Model):
|
||||||
id = models.BigAutoField(primary_key=True)
|
id = models.BigAutoField(primary_key=True)
|
||||||
description = models.CharField(
|
description = models.CharField(max_length=256, verbose_name=_("Bezeichnung"))
|
||||||
max_length=256, verbose_name=_("Bezeichnung"))
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _("Fundumstand")
|
verbose_name = _("Fundumstand")
|
||||||
|
|
|
@ -60,6 +60,7 @@
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Voliere</th>
|
<th>Voliere</th>
|
||||||
<th>Kosten</th>
|
<th>Kosten</th>
|
||||||
|
<th>Alter</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -75,6 +76,7 @@
|
||||||
<td>{{ bird.status }}</td>
|
<td>{{ bird.status }}</td>
|
||||||
<td>{{ bird.aviary|default_if_none:"" }}</td>
|
<td>{{ bird.aviary|default_if_none:"" }}</td>
|
||||||
<td>{{ bird.total_costs|default_if_none:"0,00" }} €</td>
|
<td>{{ bird.total_costs|default_if_none:"0,00" }} €</td>
|
||||||
|
<td>{{ bird.age|default_if_none:"" }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
<th>Fundort</th>
|
<th>Fundort</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Kosten</th>
|
<th>Kosten</th>
|
||||||
|
<th>Alter</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -67,6 +68,7 @@
|
||||||
<td>{{ bird.place }}</td>
|
<td>{{ bird.place }}</td>
|
||||||
<td>{{ bird.status }}</td>
|
<td>{{ bird.status }}</td>
|
||||||
<td>{{ bird.total_costs|default_if_none:"0,00" }} €</td>
|
<td>{{ bird.total_costs|default_if_none:"0,00" }} €</td>
|
||||||
|
<td>{{ bird.age|default_if_none:"" }} </td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h3>Patient <strong>{{ bird.bird_identifier }}</strong> bearbeiten </h3>
|
<h3>Patient <strong>{{ bird.bird_identifier }}</strong> bearbeiten </h3>
|
||||||
<p>Finder des Patienten: <strong> <a href="{% url 'rescuer_single' bird.rescuer_id %}">{{ bird.rescuer|default_if_none:"" }}</a></strong></p>
|
<p>Finder des Patienten: <strong> <a href="{% url 'rescuer_single' bird.rescuer_id %}">{{ bird.rescuer|default_if_none:"" }}</a></strong>.
|
||||||
|
Das Alter des Patienten bei Fund wurde mit <strong>{{ bird.age }}</strong> angegeben.</p>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-5 mb-3">
|
<div class="col-lg-5 mb-3">
|
||||||
<form method="post" enctype="multipart/form-data">
|
<form method="post" enctype="multipart/form-data">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue