2021-12-09 16:53:44 +01:00
from django import forms
2022-01-07 18:08:39 +01:00
from . models import Routine
2021-12-09 16:53:44 +01:00
class RoutineForm ( forms . ModelForm ) :
class Meta :
model = Routine
2021-12-19 09:30:51 +01:00
fields = (
" long_label " ,
" short_label " ,
" difficulty " ,
" level " ,
2022-01-09 11:07:01 +01:00
" is_active " ,
2021-12-19 09:30:51 +01:00
" informations " ,
)
2021-12-09 16:53:44 +01:00
widgets = {
2021-12-19 09:30:51 +01:00
" long_label " : forms . TextInput (
attrs = { " class " : " form-control " , " placeholder " : " Routine ' s long name " }
2021-12-09 16:53:44 +01:00
) ,
2021-12-19 09:30:51 +01:00
" short_label " : forms . TextInput (
attrs = { " class " : " form-control " , " placeholder " : " Routine ' s short name " }
2021-12-09 16:53:44 +01:00
) ,
2021-12-19 09:30:51 +01:00
" informations " : forms . Textarea (
2021-12-09 16:53:44 +01:00
attrs = {
2021-12-19 09:30:51 +01:00
" class " : " form-control " ,
2022-01-07 18:08:39 +01:00
" placeholder " : " Informations about the psychological state of mind : context (why, where, …), possible consequencies, … " , # pylint: disable=line-too-long
2021-12-09 16:53:44 +01:00
}
) ,
2021-12-19 09:30:51 +01:00
" difficulty " : forms . HiddenInput ( ) ,
" level " : forms . HiddenInput ( ) ,
2022-01-09 11:07:01 +01:00
" is_active " : forms . HiddenInput ( ) ,
2022-01-07 18:08:39 +01:00
}