This commit is contained in:
Ross
2021-08-31 18:12:26 +01:00
parent b4c18d1c3b
commit a1cc4766bb
+8 -2
View File
@@ -1,3 +1,4 @@
from django.utils.safestring import mark_safe
import django_tables2 as tables
from django_tables2.utils import A
@@ -35,11 +36,13 @@ class QuestionTable(tables.Table):
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
stem = tables.Column()
class Meta:
model = Question
template_name = "django_tables2/bootstrap4.html"
fields = (
"stem",
#"stem",
"a_answer",
"b_answer",
"c_answer",
@@ -50,7 +53,10 @@ class QuestionTable(tables.Table):
"category",
"author",
)
sequence = ("view", "exams")
sequence = ("view", "stem", "exams")
def render_stem(self, value):
return mark_safe(value)
class UserAnswerTable(tables.Table):
select = tables.CheckBoxColumn(accessor=("pk"))