我正在尝试以表格形式获取url参数值,但是我不确定该怎么做。我从中找到的许多在线答案仅适用于基于类的视图。
这是我的路径:
path('courses/<str:course_abbr>/<str:module_abbr>/<int:year>/<int:semester>/<int:stage>/designations',
views.designations, name='designations')
这是我试图将course_abbr放入的表格:
class DesignationForm(forms.Form):
class Media:
css = {
'all': ('admin/css/responsive.css', 'admin/css/base.css', 'admin/css/widgets.css',)
}
js = ('/admin/jsi18n',)
module_coordinator = forms.ModelMultipleChoiceField(queryset=Staffs.objects.all(),
widget=FilteredSelectMultiple("Module Coordinator",
is_stacked=False),
required=False,
label="")
instructor = forms.ModelMultipleChoiceField(queryset=Staffs.objects.all(),
widget=FilteredSelectMultiple("Instructor",
is_stacked=False),
required=False,
label="")
moderator = forms.ModelMultipleChoiceField(queryset=Staffs.objects.all(),
widget=FilteredSelectMultiple("Moderator",
is_stacked=False),
required=False,
label="")
verifier = forms.ModelMultipleChoiceField(queryset=Staffs.objects.all(),
widget=FilteredSelectMultiple("Verifier",
is_stacked=False),
required=False,
label="")
invigilator = forms.ModelMultipleChoiceField(queryset=Staffs.objects.all(),
widget=FilteredSelectMultiple("invigilator",
is_stacked=False),
required=False,
label="")