2023-04-25 17:06:14 +02:00
from django import forms
from . models import Skill , Routine , RoutineSkill
class SkillForm ( forms . ModelForm ) :
class Meta :
model = Skill
fields = ( " informations " , )
widgets = {
" informations " : forms . Textarea (
attrs = {
" class " : " form-control " ,
" placeholder " : " Informations about the skill : attention point, methodology, biomecanics, … " , # pylint: disable=line-too-long
}
) ,
}
2023-05-16 12:58:11 +02:00
class CombinationForm ( forms . ModelForm ) :
2023-04-25 17:06:14 +02:00
class Meta :
model = Routine
fields = (
" long_label " ,
" short_label " ,
" difficulty " ,
" level " ,
" is_active " ,
2024-02-06 11:00:21 +01:00
" is_routine " ,
" is_competitive " ,
2023-04-25 17:06:14 +02:00
" informations " ,
)
widgets = {
" long_label " : forms . TextInput (
attrs = { " class " : " form-control " , " placeholder " : " Routine ' s long name " }
) ,
" short_label " : forms . TextInput (
attrs = { " class " : " form-control " , " placeholder " : " Routine ' s short name " }
) ,
2024-02-06 11:00:21 +01:00
# "is_routine": form.,
# "is_competitive": form.,
2023-04-25 17:06:14 +02:00
" informations " : forms . Textarea (
attrs = {
" class " : " form-control " ,
" placeholder " : " Informations about the psychological state of mind : context (why, where, …), possible consequencies, … " , # pylint: disable=line-too-long
}
) ,
" difficulty " : forms . HiddenInput ( ) ,
" level " : forms . HiddenInput ( ) ,
" is_active " : forms . HiddenInput ( ) ,
}
2023-05-16 12:58:11 +02:00
class CombinationSkillForm ( forms . ModelForm ) :
2023-04-25 17:06:14 +02:00
class Meta :
model = RoutineSkill
fields = (
" routine " ,
" skill " ,
" rank " ,
)
widgets = {
" routine " : forms . HiddenInput ( ) ,
" skill " : forms . HiddenInput ( ) ,
" rank " : forms . NumberInput ( ) ,
}