From 059b3c32bf51d3bbb9db47214be5d5af6d963f36 Mon Sep 17 00:00:00 2001 From: Trullemans Gregory Date: Tue, 22 Jun 2021 08:08:32 +0200 Subject: [PATCH] [WIP] Multiples modifications dans l'app People --- src/people/forms.py | 16 +++---- .../migrations/0018_auto_20210621_1804.py | 23 ++++++++++ .../migrations/0019_auto_20210621_1809.py | 43 +++++++++++++++++++ src/people/models.py | 16 +++---- 4 files changed, 82 insertions(+), 16 deletions(-) create mode 100644 src/people/migrations/0018_auto_20210621_1804.py create mode 100644 src/people/migrations/0019_auto_20210621_1809.py diff --git a/src/people/forms.py b/src/people/forms.py index 0efed69..8816f52 100644 --- a/src/people/forms.py +++ b/src/people/forms.py @@ -96,10 +96,10 @@ class GymnastForm(forms.ModelForm): "city", "phone", "gsm", - "gsm_mother", - "email_mother", - "gsm_father", - "email_father", + "gsm_main_responsible", + "email_main_responsible", + "gsm_second_responsible", + "email_second_responsible", "orientation", "picture", "content", @@ -117,10 +117,10 @@ class GymnastForm(forms.ModelForm): "phone": forms.TextInput(attrs={"class": "form-control"}), "gsm": forms.TextInput(attrs={"class": "form-control"}), "email": forms.EmailInput(attrs={"class": "form-control"}), - "gsm_mother": forms.TextInput(attrs={"class": "form-control"}), - "email_mother": forms.EmailInput(attrs={"class": "form-control"}), - "gsm_father": forms.TextInput(attrs={"class": "form-control"}), - "email_father": forms.EmailInput(attrs={"class": "form-control"}), + "gsm_main_responsible": forms.TextInput(attrs={"class": "form-control"}), + "email_main_responsible": forms.EmailInput(attrs={"class": "form-control"}), + "gsm_second_responsible": forms.TextInput(attrs={"class": "form-control"}), + "email_second_responsible": forms.EmailInput(attrs={"class": "form-control"}), # "is_active": forms.CheckboxInput( # attrs={ # "class": "bootstrap-switch mt-0", diff --git a/src/people/migrations/0018_auto_20210621_1804.py b/src/people/migrations/0018_auto_20210621_1804.py new file mode 100644 index 0000000..a3ae865 --- /dev/null +++ b/src/people/migrations/0018_auto_20210621_1804.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.2 on 2021-06-21 18:04 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('people', '0017_alter_gymnast_user'), + ] + + operations = [ + migrations.RenameField( + model_name='gymnast', + old_name='fedid', + new_name='federation_id', + ), + migrations.RenameField( + model_name='gymnast', + old_name='have_routine', + new_name='routine', + ), + ] diff --git a/src/people/migrations/0019_auto_20210621_1809.py b/src/people/migrations/0019_auto_20210621_1809.py new file mode 100644 index 0000000..2bc2775 --- /dev/null +++ b/src/people/migrations/0019_auto_20210621_1809.py @@ -0,0 +1,43 @@ +# Generated by Django 3.2.2 on 2021-06-21 18:09 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('people', '0018_auto_20210621_1804'), + ] + + operations = [ + migrations.RenameField( + model_name='gymnast', + old_name='cando', + new_name='can_do', + ), + migrations.RenameField( + model_name='gymnast', + old_name='email_father', + new_name='email_main_responsible', + ), + migrations.RenameField( + model_name='gymnast', + old_name='email_mother', + new_name='email_second_responsible', + ), + migrations.RenameField( + model_name='gymnast', + old_name='gsm_mother', + new_name='gsm_main_responsible', + ), + migrations.RenameField( + model_name='gymnast', + old_name='gsm_father', + new_name='gsm_second_responsible', + ), + migrations.RenameField( + model_name='gymnast', + old_name='haveToDo', + new_name='have_to_do', + ), + ] diff --git a/src/people/models.py b/src/people/models.py index a5d8443..6adc6e7 100644 --- a/src/people/models.py +++ b/src/people/models.py @@ -81,17 +81,17 @@ class Gymnast(Markdownizable): max_length=9, null=True, blank=True, verbose_name="Phond" ) gsm = models.CharField(max_length=10, null=True, blank=True) - fedid = models.CharField( + federation_id = models.CharField( max_length=10, null=True, blank=True, verbose_name="Federation ID" ) - gsm_mother = models.CharField( + gsm_main_responsible = models.CharField( max_length=10, null=True, blank=True, verbose_name="GSM mère" ) - email_mother = models.EmailField(max_length=255, null=True, blank=True) - gsm_father = models.CharField( + email_main_responsible = models.EmailField(max_length=255, null=True, blank=True) + gsm_second_responsible= models.CharField( max_length=10, null=True, blank=True, verbose_name="GSM père" ) - email_father = models.EmailField(max_length=255, null=True, blank=True) + email_second_responsible = models.EmailField(max_length=255, null=True, blank=True) orientation = models.PositiveSmallIntegerField( choices=ORIENTATION_CHOICES, null=True, @@ -107,17 +107,17 @@ class Gymnast(Markdownizable): club = models.ForeignKey( "location.Club", null=True, on_delete=models.SET_NULL, related_name="gymnasts" ) - cando = models.ManyToManyField( + can_do = models.ManyToManyField( "objective.Educative", through="CanDoRelation", related_name="isdoneby", # related_name to change ) - haveToDo = models.ManyToManyField( + have_to_do = models.ManyToManyField( "objective.Educative", through="ToDoRelation", related_name="mustBeDoneBy", # related_name to change ) - have_routine = models.ManyToManyField( + routine = models.ManyToManyField( "objective.Routine", through="GymnastHasRoutine", related_name="doneBy", # related_name to change