.
This commit is contained in:
+8
-4
@@ -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
@@ -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,
|
||||
|
||||
@@ -55,6 +55,7 @@ INSTALLED_APPS = [
|
||||
"dbbackup",
|
||||
"rest_framework",
|
||||
"tinymce",
|
||||
"select2",
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -21,3 +21,4 @@ djangorestframework
|
||||
django-tinymce
|
||||
django-zipview
|
||||
pymemcache
|
||||
django-select2-forms
|
||||
Reference in New Issue
Block a user