strat tidying up anatomy question form

This commit is contained in:
Ross
2024-10-07 11:04:07 +01:00
parent 3616d1b9c5
commit 48e6339ecb
7 changed files with 52 additions and 24 deletions
+15 -4
View File
@@ -33,6 +33,9 @@ from dal import autocomplete
from tinymce.widgets import TinyMCE
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
class AnatomyAnswerForm(ModelForm):
class Meta:
model = UserAnswer
@@ -76,6 +79,14 @@ class AnatomyQuestionForm(ModelForm):
ModelForm.__init__(self, *args, **kwargs)
super(AnatomyQuestionForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.form_id = 'id-anatomy-question-form'
#self.helper.form_class = 'blueForms'
#self.helper.form_method = 'post'
#self.helper.form_action = ''
#self.helper.add_input(Submit('submit', 'Submit'))
# self.fields['question'].widget.attrs = {'class': 'question-form', 'rows': 10, 'cols': 100}
# self.fields['feedback'].widget.attrs = {'class': 'feedback-form', 'rows': 10, 'cols': 100}
self.fields["question_type"] = ModelChoiceField(
@@ -145,15 +156,15 @@ class AnatomyQuestionForm(ModelForm):
fields = [
"question_type",
"image",
"answer_help",
"answer_suggest_incorrect",
"region",
"description",
"modality",
"region",
"structure",
"feedback",
"examination",
"body_part",
"description",
"answer_help",
"answer_suggest_incorrect",
"open_access",
]