1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-02-11 18:51:19 +00:00
nk20/apps/sheets/tables.py
Yohann D'ANELLO 51e5e3669e
Add interface to create and see note sheets
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
2022-08-18 14:27:02 +02:00

23 lines
680 B
Python

# Copyright (C) 2018-2022 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
import django_tables2 as tables
from django.urls import reverse_lazy
from sheets.models import Sheet
class SheetTable(tables.Table):
class Meta:
attrs = {
'class': 'table table-condensed table-striped table-hover'
}
model = Sheet
template_name = 'django_tables2/bootstrap4.html'
fields = ('name', 'date', )
row_attrs = {
'class': 'table-row',
'id': lambda record: "row-" + str(record.pk),
'data-href': lambda record: reverse_lazy('sheets:sheet_detail', args=(record.pk,))
}