.
This commit is contained in:
+14
-1
@@ -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),
|
||||
)
|
||||
Reference in New Issue
Block a user