From 27541c6fb60395b47107e4e78a2a7a8ceec871e8 Mon Sep 17 00:00:00 2001 From: moanos Date: Thu, 21 Nov 2024 22:50:04 +0100 Subject: [PATCH] feat: add choice with all --- .../migrations/0025_alter_animal_sex.py | 18 ++++++++++++++++++ .../migrations/0026_alter_animal_sex.py | 18 ++++++++++++++++++ src/fellchensammlung/models.py | 19 ++++++++++++++----- 3 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 src/fellchensammlung/migrations/0025_alter_animal_sex.py create mode 100644 src/fellchensammlung/migrations/0026_alter_animal_sex.py diff --git a/src/fellchensammlung/migrations/0025_alter_animal_sex.py b/src/fellchensammlung/migrations/0025_alter_animal_sex.py new file mode 100644 index 0000000..112d2f4 --- /dev/null +++ b/src/fellchensammlung/migrations/0025_alter_animal_sex.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.1 on 2024-11-21 19:41 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('fellchensammlung', '0024_alter_animal_sex'), + ] + + operations = [ + migrations.AlterField( + model_name='animal', + name='sex', + field=models.CharField(choices=[('F', 'Weiblich'), ('M', 'Männlich'), ('M_N', 'Männlich, kastriert'), ('F_N', 'Weiblich Kastriert'), ('I', 'Intersex')], max_length=20), + ), + ] diff --git a/src/fellchensammlung/migrations/0026_alter_animal_sex.py b/src/fellchensammlung/migrations/0026_alter_animal_sex.py new file mode 100644 index 0000000..3a1e1c5 --- /dev/null +++ b/src/fellchensammlung/migrations/0026_alter_animal_sex.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.1 on 2024-11-21 21:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('fellchensammlung', '0025_alter_animal_sex'), + ] + + operations = [ + migrations.AlterField( + model_name='animal', + name='sex', + field=models.CharField(choices=[('F', 'Weiblich'), ('M', 'Männlich'), ('M_N', 'Männlich, kastriert'), ('F_N', 'Weiblich, kastriert'), ('I', 'Intergeschlechtlich')], max_length=20), + ), + ] diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py index 2527852..542ba2e 100644 --- a/src/fellchensammlung/models.py +++ b/src/fellchensammlung/models.py @@ -461,11 +461,20 @@ class AdoptionNoticeStatus(models.Model): class SexChoices(models.TextChoices): - MALE_NEUTERED = "M_N", "neutered male" - MALE = "M", "male" - FEMALE_NEUTERED = "F_N", "neutered female" - FEMALE = "F", "female" - INTER = "I", "intersex" + FEMALE = "F", _("Weiblich") + MALE = "M", _("Männlich") + MALE_NEUTERED = "M_N", _("Männlich, kastriert") + FEMALE_NEUTERED = "F_N", _("Weiblich, kastriert") + INTER = "I", _("Intergeschlechtlich") + + +class SexChoicesWithAll(models.TextChoices): + FEMALE = "F", _("Weiblich") + MALE = "M", _("Männlich") + MALE_NEUTERED = "M_N", _("Männlich, kastriert") + FEMALE_NEUTERED = "F_N", _("Weiblich Kastriert") + INTER = "I", _("Intergeschlechtlich") + ALL = "A", _("Alle") class Animal(models.Model):