Jarvis/jarvis/objective/forms.py

69 lines
2.0 KiB
Python

from django import forms
from .models import Skill, Combination, CombinationSkill
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
}
),
}
class CombinationForm(forms.ModelForm):
class Meta:
model = Combination
fields = (
"long_label",
"short_label",
"difficulty",
"level",
"is_active",
"informations",
)
widgets = {
"long_label": forms.TextInput(
attrs={
"class": "form-control",
"placeholder": "Combination's long name",
}
),
"short_label": forms.TextInput(
attrs={
"class": "form-control",
"placeholder": "Combination'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(),
"is_active": forms.HiddenInput(),
}
class CombinationSkillForm(forms.ModelForm):
class Meta:
model = CombinationSkill
fields = (
"combination",
"skill",
"rank",
)
widgets = {
"combination": forms.HiddenInput(),
"skill": forms.HiddenInput(),
"rank": forms.NumberInput(),
}