Files
penracourses/oef/tables.py
T
Ross fad940bcd4 .
2024-11-11 13:59:48 +00:00

39 lines
799 B
Python
Executable File

import django_tables2 as tables
from django_tables2.utils import A
from generic.tables import SeriesImageColumn
from .models import (
Entry,
Formats
)
from django.utils.html import format_html
class EntryTable(tables.Table):
view = tables.LinkColumn(
"oef:entry_detail", text="View", args=[A("pk")], orderable=False
)
edit = tables.LinkColumn(
"oef:entry_update", text="Edit", args=[A("pk")], orderable=False
)
class Meta:
model = Entry
template_name = "django_tables2/bootstrap4.html"
fields = (
"modality",
"exam_code",
"exam_name",
"questions",
"comments",
)
def render_questions(self, value):
return format_html("<pre>{}</pre>", value)