This commit is contained in:
Ross
2021-10-20 17:59:19 +01:00
parent 52a951e5d2
commit b26564c4ab
5 changed files with 15 additions and 6 deletions
+8 -4
View File
@@ -25,6 +25,7 @@ from generic.models import Examination
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.forms.widgets import RadioSelect, TextInput, Textarea
import select2.fields
class AnatomyAnswerForm(ModelForm):
class Meta:
@@ -85,10 +86,13 @@ class AnatomyQuestionForm(ModelForm):
queryset=Modality.objects.all(),
)
self.fields["structure"] = ModelChoiceField(
required=False,
queryset=Structure.objects.all(),
)
#self.fields["structure"] = ModelChoiceField(
# required=False,
# queryset=Structure.objects.all(),
#)
self.fields["structure"] =select2.fields.ChoiceField(
choices=Structure.objects.all(),
overlay="Choose an author...")
self.fields["examination"] = ModelChoiceField(
required=False,
+1 -1
View File
@@ -79,7 +79,7 @@ class AnatomyQuestion(models.Model):
QuestionType, on_delete=models.SET_NULL, null=True, default=1
)
image = models.ImageField(upload_to=image_directory_path)
image = models.ImageField(upload_to=image_directory_path, help_text="The image to use for the question. Ideally use use unmarked images and annotate (arrow) them on the test system. If you wish to reuse an image that is already uploaded 'clone' the question that contains it.As a preference")
image_annotations = models.TextField(
blank=True,
+1
View File
@@ -55,6 +55,7 @@ INSTALLED_APPS = [
"dbbackup",
"rest_framework",
"tinymce",
"select2",
]
MIDDLEWARE = [
+3
View File
@@ -76,6 +76,9 @@ urlpatterns = [
path('api-auth/', include('rest_framework.urls')),
path('tinymce/', include('tinymce.urls')),
path('select2/', include('select2.urls')),
]
#handler400 = 'my_app.views.bad_request'
+2 -1
View File
@@ -20,4 +20,5 @@ django-hashedfilenamestorage
djangorestframework
django-tinymce
django-zipview
pymemcache
pymemcache
django-select2-forms