Ultron/ultron/people/forms.py

52 lines
1.4 KiB
Python

"""Formulaires de gestion des données entrantes pour les gymnastes et accidents."""
from django import forms
from .models import (
Gymnast
)
class GymnastForm(forms.ModelForm):
class Meta:
model = Gymnast
fields = (
'last_name',
'first_name',
'birthdate',
'gender',
'is_active',
'club',
'trainings_by_week',
'hours_by_week'
)
widgets = {
"last_name": forms.TextInput(
attrs={"class": "form-control", "placeholder": "Lastname"}
),
"first_name": forms.TextInput(
attrs={"class": "form-control", "placeholder": "Firstname"}
),
"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"}
),
"hours_by_week": forms.TextInput(
attrs={"class": "form-control", "placeholder": "11,5"}
),
}
club_related = forms.CharField(
widget=forms.TextInput(
attrs={
"class": "form-control",
"placeholder": "Searching club…",
"data-ref": "#id_club",
}
)
)