Refactor tables to inherit from SelectionTable for consistent behavior across Anatomy and Question tables
This commit is contained in:
+4
-4
@@ -2,7 +2,7 @@
|
||||
import django_tables2 as tables
|
||||
from django_tables2.utils import A
|
||||
|
||||
from generic.tables import FirstImageColumn
|
||||
from generic.tables import FirstImageColumn, SelectionTable
|
||||
|
||||
from .models import Question, UserAnswer
|
||||
|
||||
@@ -15,7 +15,7 @@ from easy_thumbnails.exceptions import InvalidImageFormatError
|
||||
|
||||
|
||||
|
||||
class QuestionTable(tables.Table):
|
||||
class QuestionTable(SelectionTable):
|
||||
edit = tables.LinkColumn('shorts:question_update',
|
||||
text='Edit',
|
||||
args=[A('pk')],
|
||||
@@ -36,9 +36,9 @@ class QuestionTable(tables.Table):
|
||||
|
||||
exams = tables.ManyToManyColumn(verbose_name="Exams")
|
||||
|
||||
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
|
||||
#selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
|
||||
|
||||
class Meta:
|
||||
class Meta(SelectionTable.Meta):
|
||||
model = Question
|
||||
template_name = "django_tables2/bootstrap4.html"
|
||||
fields = ("normal", "examination",
|
||||
|
||||
Reference in New Issue
Block a user