From a1cc4766bbc49e60c3d37144c028cebaaaa49600 Mon Sep 17 00:00:00 2001 From: Ross Date: Tue, 31 Aug 2021 18:12:26 +0100 Subject: [PATCH] . --- sbas/tables.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sbas/tables.py b/sbas/tables.py index 2152583f..fcb1f9d9 100644 --- a/sbas/tables.py +++ b/sbas/tables.py @@ -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"))