Geschlecht Patient #32
This commit is contained in:
parent
4f842b0311
commit
b1a10b26f1
5 changed files with 22 additions and 43 deletions
|
@ -8,12 +8,14 @@ class FallenBirdAdmin(admin.ModelAdmin):
|
||||||
list_display = [
|
list_display = [
|
||||||
"bird",
|
"bird",
|
||||||
"age",
|
"age",
|
||||||
|
"sex",
|
||||||
"date_found",
|
"date_found",
|
||||||
"place",
|
"place",
|
||||||
"created",
|
"created",
|
||||||
"updated",
|
"updated",
|
||||||
"user",
|
"user",
|
||||||
"status"]
|
"status",
|
||||||
|
]
|
||||||
list_filter = ("bird", "created", "user", "status")
|
list_filter = ("bird", "created", "user", "status")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,18 +11,16 @@ class DateInput(forms.DateInput):
|
||||||
|
|
||||||
|
|
||||||
class BirdAddForm(forms.ModelForm):
|
class BirdAddForm(forms.ModelForm):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
widgets = {
|
widgets = {
|
||||||
"date_found": DateInput(
|
"date_found": DateInput(format="%Y-%m-%d", attrs={"value": date.today})
|
||||||
format="%Y-%m-%d",
|
}
|
||||||
attrs={
|
|
||||||
"value": date.today})}
|
|
||||||
model = FallenBird
|
model = FallenBird
|
||||||
fields = [
|
fields = [
|
||||||
"bird_identifier",
|
"bird_identifier",
|
||||||
"bird",
|
"bird",
|
||||||
"age",
|
"age",
|
||||||
|
"sex",
|
||||||
"date_found",
|
"date_found",
|
||||||
"place",
|
"place",
|
||||||
"find_circumstances",
|
"find_circumstances",
|
||||||
|
@ -32,6 +30,7 @@ class BirdAddForm(forms.ModelForm):
|
||||||
"bird_identifier": _("Kennung"),
|
"bird_identifier": _("Kennung"),
|
||||||
"bird": _("Vogel"),
|
"bird": _("Vogel"),
|
||||||
"age": _("Alter"),
|
"age": _("Alter"),
|
||||||
|
"sex": _("Geschlecht"),
|
||||||
"date_found": _("Datum des Fundes"),
|
"date_found": _("Datum des Fundes"),
|
||||||
"place": _("Fundort"),
|
"place": _("Fundort"),
|
||||||
"find_circumstances": _("Fundumstände"),
|
"find_circumstances": _("Fundumstände"),
|
||||||
|
@ -46,6 +45,7 @@ class BirdEditForm(forms.ModelForm):
|
||||||
fields = [
|
fields = [
|
||||||
"bird_identifier",
|
"bird_identifier",
|
||||||
"bird",
|
"bird",
|
||||||
|
"sex",
|
||||||
"date_found",
|
"date_found",
|
||||||
"place",
|
"place",
|
||||||
"status",
|
"status",
|
||||||
|
@ -56,6 +56,7 @@ class BirdEditForm(forms.ModelForm):
|
||||||
]
|
]
|
||||||
labels = {
|
labels = {
|
||||||
"bird": _("Vogel"),
|
"bird": _("Vogel"),
|
||||||
|
"sex": _("Geschlecht"),
|
||||||
"date_found": _("Datum des Fundes"),
|
"date_found": _("Datum des Fundes"),
|
||||||
"place": _("Fundort"),
|
"place": _("Fundort"),
|
||||||
"status": _("Status"),
|
"status": _("Status"),
|
||||||
|
|
|
@ -17,6 +17,12 @@ CHOICE_AGE = [
|
||||||
("Adult", "Adult"),
|
("Adult", "Adult"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
CHOICE_SEX = [
|
||||||
|
("Weiblich", "Weiblich"),
|
||||||
|
("Männlich", "Männlich"),
|
||||||
|
("Unbekannt", "Unbekannt"),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
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"}]
|
||||||
|
@ -28,10 +34,9 @@ class FallenBird(models.Model):
|
||||||
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(
|
age = models.CharField(max_length=15, choices=CHOICE_AGE, verbose_name=_("Alter"))
|
||||||
max_length=15,
|
sex = models.CharField(
|
||||||
choices=CHOICE_AGE,
|
max_length=15, choices=CHOICE_SEX, verbose_name=_("Geschlecht")
|
||||||
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"))
|
||||||
|
|
|
@ -61,6 +61,7 @@
|
||||||
<th>Voliere</th>
|
<th>Voliere</th>
|
||||||
<th>Kosten</th>
|
<th>Kosten</th>
|
||||||
<th>Alter</th>
|
<th>Alter</th>
|
||||||
|
<th>Geschlecht</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -77,6 +78,7 @@
|
||||||
<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>
|
<td>{{ bird.age|default_if_none:"" }}</td>
|
||||||
|
<td>{{ bird.sex }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Kosten</th>
|
<th>Kosten</th>
|
||||||
<th>Alter</th>
|
<th>Alter</th>
|
||||||
|
<th>Geschlecht</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -69,41 +70,9 @@
|
||||||
<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>
|
<td>{{ bird.age|default_if_none:"" }} </td>
|
||||||
|
<td>{{ bird.sex }} </td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="modal fade" id="addPatientModal" tabindex="-1" data-bs-backdrop="static"
|
|
||||||
aria-labelledby="addRescuerModalLabel" aria-hidden="true">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header bg-primary">
|
|
||||||
<h5 class="modal-title text-white" id="addRescuerModalLabel">(neuen) Finder zuweisen</h5>
|
|
||||||
</div>
|
|
||||||
<form method="post">
|
|
||||||
{% csrf_token %}
|
|
||||||
<div class="modal-body">
|
|
||||||
<label for="rescuer" class="form-label mt-3">Wählen Sie einen <strong>bereits angelegten</strong>
|
|
||||||
Finder aus oder legen Sie einen <strong>neuen</strong> Finder an:</label>
|
|
||||||
<select id="rescuer" class="form-select" name="rescuer_id">
|
|
||||||
<option value="new_rescuer"><strong>neuen
|
|
||||||
Finder anlegen</strong></option>
|
|
||||||
{% for rescuer in rescuer_modal %}
|
|
||||||
<option value={{rescuer.id}}>
|
|
||||||
{{rescuer.first_name}} {{rescuer.last_name}},
|
|
||||||
{{rescuer.street}} {{rescuer.street_number}},
|
|
||||||
{{rescuer.city}}
|
|
||||||
</option>
|
|
||||||
{% endfor %}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-danger" data-bs-dismiss="modal">Abbruch</button>
|
|
||||||
<button class="btn btn-primary" type="submit">Übernehmen und weiter</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue