Add edit link column to QuestionTable for improved item management

This commit is contained in:
Ross
2025-10-20 13:39:23 +01:00
parent 272c3381e1
commit 7e7a1b8763
+5
View File
@@ -24,6 +24,10 @@ class QuestionTable(tables.Table):
stem = tables.Column()
answers = tables.TemplateColumn("<ol type='A'><li>{{ record.a_answer|safe}}</li><li>{{ record.b_answer|safe}}</li><li>{{ record.c_answer|safe}}</li><li>{{ record.d_answer|safe}}</li><li>{{ record.e_answer|safe}}</li></ol>")
edit = tables.LinkColumn(
"sbas:question_update", text="Edit", args=[A("pk")], orderable=False
)
class Meta:
model = Question
template_name = "django_tables2/bootstrap4.html"
@@ -38,6 +42,7 @@ class QuestionTable(tables.Table):
"created_date",
"category",
"author",
"edit"
)
sequence = ("view", "stem", "answers")#, "exams")
attrs = {"class": "table row-selector"}