from django import forms from .models import Routine class RoutineForm(forms.ModelForm): class Meta: model = Routine fields = ( "long_label", "short_label", "difficulty", "level", "active", "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"} ), "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(), "active": forms.HiddenInput(), }