Bug fix and issue #19 preparation

This commit is contained in:
Trullemans Gregory 2020-11-01 11:44:08 +01:00
parent 6c03f29f3a
commit be34c0f6a9
4 changed files with 15 additions and 13 deletions

View File

@ -3,7 +3,9 @@ from django.db import models
from django.contrib.auth.models import User from django.contrib.auth.models import User
from datetime import datetime from datetime import datetime
class Message(models.Model): from base.models import Markdownizable
class Message(Markdownizable):
"""Représente un message échangé entre deux utilisateurs. """Représente un message échangé entre deux utilisateurs.
Attributes: Attributes:

View File

@ -12,7 +12,7 @@ from .models import (
class AccidentForm(forms.ModelForm): class AccidentForm(forms.ModelForm):
class Meta: class Meta:
model = Accident model = Accident
fields = ("gymnast", "educative", "date", "information") fields = ("gymnast", "educative", "date", "content")
widgets = { widgets = {
"date": forms.DateInput( "date": forms.DateInput(
attrs={ attrs={
@ -22,7 +22,7 @@ class AccidentForm(forms.ModelForm):
), ),
"gymnast": forms.HiddenInput(), "gymnast": forms.HiddenInput(),
"educative": forms.HiddenInput(), "educative": forms.HiddenInput(),
"information": forms.Textarea( "content": forms.Textarea(
attrs={ attrs={
"class": "form-control", "class": "form-control",
"placeholder": "Informations about accident: context (why, where, …), consequencies, …", "placeholder": "Informations about accident: context (why, where, …), consequencies, …",
@ -72,7 +72,7 @@ class GymnastForm(forms.ModelForm):
"active", "active",
"orientation", "orientation",
"picture", "picture",
"information", "content",
) )
widgets = { widgets = {
"id": forms.HiddenInput(), "id": forms.HiddenInput(),
@ -99,7 +99,7 @@ class GymnastForm(forms.ModelForm):
), ),
"orientation": forms.Select(attrs={"class": "form-control"}), "orientation": forms.Select(attrs={"class": "form-control"}),
"picture": forms.Select(attrs={"class": "form-control"}), "picture": forms.Select(attrs={"class": "form-control"}),
"information": forms.Textarea( "content": forms.Textarea(
attrs={ attrs={
"class": "form-control", "class": "form-control",
"placeholder": "Informations about the gymnast.", "placeholder": "Informations about the gymnast.",

View File

@ -133,9 +133,9 @@ class CourseAdmin(admin.ModelAdmin):
class UnavailabilityAdmin(admin.ModelAdmin): class UnavailabilityAdmin(admin.ModelAdmin):
model = Unavailability model = Unavailability
list_display = ("datebegin", "dateend", "information") list_display = ("datebegin", "dateend", "content")
ordering = ("datebegin", "dateend") ordering = ("datebegin", "dateend")
search_fields = ("information",) search_fields = ("content",)
filter_horizontal = ("course",) filter_horizontal = ("course",)

View File

@ -10,7 +10,7 @@ from .models import Unavailability, Event, PlanningLine
class UnavailabilityForm(forms.ModelForm): class UnavailabilityForm(forms.ModelForm):
class Meta: class Meta:
model = Unavailability model = Unavailability
fields = ("datebegin", "dateend", "information") fields = ("datebegin", "dateend", "content")
widgets = { widgets = {
"datebegin": forms.TextInput( "datebegin": forms.TextInput(
attrs={ attrs={
@ -28,7 +28,7 @@ class UnavailabilityForm(forms.ModelForm):
"placeholder": date.today().strftime("%d/%m/%Y"), "placeholder": date.today().strftime("%d/%m/%Y"),
} }
), ),
"information": forms.Textarea( "content": forms.Textarea(
attrs={ attrs={
"class": "form-control", "class": "form-control",
"placeholder": "Informations about unavailability: context (why, where, …), …", "placeholder": "Informations about unavailability: context (why, where, …), …",
@ -49,7 +49,7 @@ class EventForm(forms.ModelForm):
"dateend", "dateend",
"place", "place",
"eventtype", "eventtype",
"information", "content",
) # , 'gymnasts' ) # , 'gymnasts'
widgets = { widgets = {
"place": forms.HiddenInput(), "place": forms.HiddenInput(),
@ -71,7 +71,7 @@ class EventForm(forms.ModelForm):
"placeholder": date.today().strftime("%Y-%m-%d 18:00"), "placeholder": date.today().strftime("%Y-%m-%d 18:00"),
} }
), ),
"information": forms.Textarea( "content": forms.Textarea(
attrs={ attrs={
"class": "form-control", "class": "form-control",
"placeholder": "Informations about unavailability: context (why, where, …), …", "placeholder": "Informations about unavailability: context (why, where, …), …",
@ -102,7 +102,7 @@ class PlanningLineForm(forms.ModelForm):
class Meta: class Meta:
model = PlanningLine model = PlanningLine
fields = ("gymnast", "date", "order", "todo", "information") fields = ("gymnast", "date", "order", "todo", "content")
widgets = { widgets = {
"gymnast": forms.HiddenInput(), "gymnast": forms.HiddenInput(),
"date": forms.TextInput( "date": forms.TextInput(
@ -115,7 +115,7 @@ class PlanningLineForm(forms.ModelForm):
), ),
"order": forms.TextInput(attrs={"class": "form-control col-sm-5"}), "order": forms.TextInput(attrs={"class": "form-control col-sm-5"}),
"todo": forms.TextInput(attrs={"class": "form-control col-sm-5"}), "todo": forms.TextInput(attrs={"class": "form-control col-sm-5"}),
"information": forms.Textarea( "content": forms.Textarea(
attrs={ attrs={
"class": "form-control", "class": "form-control",
"placeholder": "Informations about unavailability: context (why, where, …), …", "placeholder": "Informations about unavailability: context (why, where, …), …",