This commit is contained in:
Ross
2022-05-18 17:55:48 +01:00
parent 40e7ff29bf
commit 72cf7b0c3e
6 changed files with 42 additions and 3 deletions
+14 -1
View File
@@ -23,6 +23,7 @@ from rapids.models import (
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.forms.widgets import RadioSelect, TextInput, Textarea
from django.contrib.auth.models import User
class RapidAnswerForm(ModelForm):
@@ -189,7 +190,7 @@ class RapidForm(ModelForm):
ImageFormSet = inlineformset_factory(
Rapid,
RapidImage,
fields=["image", "feedback_image", "description"],
fields=["image", "feedback_image", "filename", "description"],
exclude=[],
can_delete=True,
extra=1,
@@ -244,3 +245,15 @@ class ExamForm(ExamFormMixin, ModelForm):
"cid_user_groups",
#"author",
]
class ExamAuthorForm(ModelForm):
class Meta:
model = Exam
fields = ["author"]
def __init__(self, *args, **kwargs):
ModelForm.__init__(self, *args, **kwargs)
self.fields["author"] = ModelMultipleChoiceField(
queryset=User.objects.all(),
widget=FilteredSelectMultiple(verbose_name="Authors", is_stacked=False),
)