.
This commit is contained in:
+26
-2
@@ -1,7 +1,7 @@
|
||||
import django_tables2 as tables
|
||||
from django_tables2.utils import A
|
||||
|
||||
from .models import Long, LongSeries
|
||||
from .models import Long, LongSeries, CidUserAnswer
|
||||
|
||||
from django.utils.html import format_html
|
||||
|
||||
@@ -111,4 +111,28 @@ class LongSeriesTable(tables.Table):
|
||||
|
||||
def render_popup(self, value, record):
|
||||
print(self)
|
||||
return format_html("""<a href="#" onclick="return window.create_popup_window('/longs/series/{}', 'Series')" >Popup</a>""", record.pk)
|
||||
return format_html("""<a href="#" onclick="return window.create_popup_window('/longs/series/{}', 'Series')" >Popup</a>""", record.pk)
|
||||
|
||||
class UserAnswerTable(tables.Table):
|
||||
select = tables.CheckBoxColumn(accessor=("pk"))
|
||||
delete = tables.LinkColumn(
|
||||
"longs:user_answer_delete", text="Delete", args=[A("pk")], orderable=False
|
||||
)
|
||||
view = tables.LinkColumn('longs:user_answer_view',
|
||||
text='View',
|
||||
args=[A('pk')],
|
||||
orderable=False)
|
||||
class Meta:
|
||||
model = CidUserAnswer
|
||||
template_name = "django_tables2/bootstrap4.html"
|
||||
fields = (
|
||||
"cid",
|
||||
"question",
|
||||
"normal",
|
||||
"answer",
|
||||
#"answer_compare",
|
||||
"exam",
|
||||
"created",
|
||||
"updated",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user