diff --git a/src/base/models.py b/src/base/models.py index 5cad5ab..8851c49 100644 --- a/src/base/models.py +++ b/src/base/models.py @@ -6,12 +6,12 @@ import markdown class Markdownizable(models.Model): - """Classe abstraite ajoutant un champ `information`, convertible de .md -> .html.""" + """Classe abstraite ajoutant un champ `content`, convertible de .md -> .html.""" class Meta: abstract = True - information = models.TextField( + content = models.TextField( null=True, blank=True, verbose_name="Comments", @@ -19,6 +19,6 @@ class Markdownizable(models.Model): ) def to_markdown(self): - """Convertit le champ `information` en (Github-flavored) Markdown.""" + """Convertit le champ `content` en (Github-flavored) Markdown.""" - return markdown.markdown(self.information) + return markdown.markdown(self.content) diff --git a/src/communication/views.py b/src/communication/views.py index d49e12a..8b8fb17 100644 --- a/src/communication/views.py +++ b/src/communication/views.py @@ -15,7 +15,7 @@ from .models import Message def get_number_of_unread_message(request): """Récupère le nombre de messages non lus associés à l'utilisateur en session. """ - return Message.objects.filter(reader=request.user).filter(read_at__isnull=True).count() + return Message.objects.filter(recipient=request.user).filter(read_at__isnull=True).count() @login_required @@ -32,9 +32,9 @@ def get_messages(request, message_type="received"): Si le paramètre `message_type` est vide, la liste renvoyée est vide également. """ if message_type == "received": - message_list = Message.objects.filter(reader=request.user) + message_list = Message.objects.filter(recipient=request.user) elif message_type == "sent": - message_list = Message.objects.filter(writer=request.user) + message_list = Message.objects.filter(sender=request.user) else: message_list = None @@ -64,7 +64,7 @@ def get_message_details(request, messageid): """Récupère les détails (l'affichage ?) d'un message. """ message = get_object_or_404(Message, pk=messageid) - if not message.is_read and message.reader == request.user.id: + if not message.is_read and message.recipient == request.user.id: message.is_read = True message.save() diff --git a/src/planning/views.py b/src/planning/views.py index 26dcf6e..2fdd02c 100644 --- a/src/planning/views.py +++ b/src/planning/views.py @@ -1295,19 +1295,19 @@ def planningline_update(request, planninglineid=None): planningline.date = form.cleaned_data["date"] planningline.order = form.cleaned_data["order"] planningline.todo = form.cleaned_data["todo"] - planningline.information = form.cleaned_data["information"] + planningline.content = form.cleaned_data["content"] planningline.save() return HttpResponseRedirect("/program/") else: form = PlanningLineForm( initial={ - "gymnast": planningline.gymnast.id, + "gymnast": planningline.gymnast.id, "gymnast_related": planningline.gymnast, "date": planningline.date, "order": planningline.order, "todo": planningline.todo, - "information": planningline.information, + "content": planningline.content, } ) diff --git a/src/templates/accident_create.html b/src/templates/accident_create.html index eafac74..ce4cbbf 100644 --- a/src/templates/accident_create.html +++ b/src/templates/accident_create.html @@ -36,7 +36,7 @@
- {{ form.information }} + {{ form.content }}
diff --git a/src/templates/event_create.html b/src/templates/event_create.html index d82600f..9f4e45c 100644 --- a/src/templates/event_create.html +++ b/src/templates/event_create.html @@ -69,10 +69,10 @@
- -
- {{ form.information }} - {% if form.information.errors %} {% for error in form.information.errors %}{{error}}{% endfor %}{% endif %} + +
+ {{ form.content }} + {% if form.content.errors %} {% for error in form.content.errors %}{{error}}{% endfor %}{% endif %}
diff --git a/src/templates/gymnast_create.html b/src/templates/gymnast_create.html index e889bfa..fb8ab51 100644 --- a/src/templates/gymnast_create.html +++ b/src/templates/gymnast_create.html @@ -119,11 +119,11 @@ {% if form.orientation.errors %} {% for error in form.orientation.errors %}{{error}}{% endfor %}{% endif %}
-
- +
+
- {{ form.information }} - {% if form.information.errors %} {% for error in form.information.errors %}{{error}}{% endfor %}{% endif %} + {{ form.content }} + {% if form.content.errors %} {% for error in form.content.errors %}{{error}}{% endfor %}{% endif %}
diff --git a/src/templates/planningline_create.html b/src/templates/planningline_create.html index f591daf..cb02fe1 100644 --- a/src/templates/planningline_create.html +++ b/src/templates/planningline_create.html @@ -45,11 +45,11 @@ {% if form.todo.errors %} {% for error in form.todo.errors %}{{error}}{% endfor %}{% endif %}
-
- +
+
- {{ form.information }} - {% if form.information.errors %} {% for error in form.information.errors %}{{error}}{% endfor %}{% endif %} + {{ form.content }} + {% if form.content.errors %} {% for error in form.content.errors %}{{error}}{% endfor %}{% endif %}
diff --git a/src/templates/program.html b/src/templates/program.html index 046022f..d06d329 100644 --- a/src/templates/program.html +++ b/src/templates/program.html @@ -52,7 +52,7 @@
-

{{ gymnast.information }}

+

{{ gymnast.content }}

diff --git a/src/templates/program_day.html b/src/templates/program_day.html index 8783e5b..c74fde4 100644 --- a/src/templates/program_day.html +++ b/src/templates/program_day.html @@ -69,7 +69,7 @@
-

{{ gymnast.information }}

+

{{ gymnast.content }}

diff --git a/src/templates/program_old.html b/src/templates/program_old.html index be56d3f..3e55a35 100644 --- a/src/templates/program_old.html +++ b/src/templates/program_old.html @@ -52,7 +52,7 @@
-

{{ gymnast.information }}

+

{{ gymnast.content }}

diff --git a/src/templates/routine_details.html b/src/templates/routine_details.html index ed756dd..96e8cb0 100644 --- a/src/templates/routine_details.html +++ b/src/templates/routine_details.html @@ -44,7 +44,7 @@
- {% if routine.information %} + {% if routine.content %}

Commentaires

diff --git a/src/templates/skill_details.html b/src/templates/skill_details.html index 6febb1b..35ace3e 100644 --- a/src/templates/skill_details.html +++ b/src/templates/skill_details.html @@ -59,7 +59,7 @@ {% endif %}
- {% if skill.information %} + {% if skill.content %}
diff --git a/src/templates/unavailability_create.html b/src/templates/unavailability_create.html index c259f9c..70015d3 100644 --- a/src/templates/unavailability_create.html +++ b/src/templates/unavailability_create.html @@ -33,7 +33,7 @@
- {{ form.information }} + {{ form.content }}
diff --git a/src/templates/unavailability_list.html b/src/templates/unavailability_list.html index 23059e7..565a28d 100644 --- a/src/templates/unavailability_list.html +++ b/src/templates/unavailability_list.html @@ -28,7 +28,7 @@ {{ unavailable.datebegin | date:"d-m-Y" }} {{ unavailable.dateend | date:"d-m-Y" }} - {{ unavailable.information }} + {{ unavailable.content }} {% endfor %}