Ultron/ultron/people/forms.py

49 lines
1.4 KiB
Python
Raw Normal View History

2021-12-19 09:30:51 +01:00
"""Formulaires de gestion des données entrantes pour les gymnastes et accidents."""
2021-12-09 16:53:44 +01:00
from django import forms
2021-12-19 09:30:51 +01:00
from .models import Gymnast
2021-12-09 16:53:44 +01:00
2021-12-19 09:30:51 +01:00
class GymnastForm(forms.ModelForm):
2021-12-09 16:53:44 +01:00
class Meta:
model = Gymnast
fields = (
2021-12-19 09:30:51 +01:00
"last_name",
"first_name",
"birthdate",
"gender",
"is_active",
"club",
"trainings_by_week",
"hours_by_week",
2021-12-09 16:53:44 +01:00
)
widgets = {
2021-12-19 09:30:51 +01:00
"last_name": forms.TextInput(
attrs={"class": "form-control", "placeholder": "Lastname"}
2021-12-09 16:53:44 +01:00
),
2021-12-19 09:30:51 +01:00
"first_name": forms.TextInput(
attrs={"class": "form-control", "placeholder": "Firstname"}
2021-12-09 16:53:44 +01:00
),
2021-12-19 09:30:51 +01:00
"birthdate": forms.DateInput(attrs={"class": "form-control datepicker"}),
"gender": forms.Select(attrs={"class": "form-control"}),
"club": forms.HiddenInput(),
"trainings_by_week": forms.TextInput(
attrs={"class": "form-control", "placeholder": "5"}
2021-12-09 16:53:44 +01:00
),
2021-12-19 09:30:51 +01:00
"hours_by_week": forms.TextInput(
attrs={"class": "form-control", "placeholder": "11,5"}
2021-12-09 16:53:44 +01:00
),
}
club_related = forms.CharField(
widget=forms.TextInput(
attrs={
2021-12-19 09:30:51 +01:00
"class": "form-control",
"placeholder": "Searching club…",
"data-ref": "#id_club",
2021-12-09 16:53:44 +01:00
}
)
)