From 10f7ef404576ca4f86abf864a38b2c18a687d5e7 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Thu, 15 Aug 2019 21:52:10 +0200 Subject: [PATCH] Club list is now clickable --- apps/member/tables.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 apps/member/tables.py diff --git a/apps/member/tables.py b/apps/member/tables.py new file mode 100644 index 00000000..e9000227 --- /dev/null +++ b/apps/member/tables.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +import django_tables2 as tables +from .models import Club + + +class ClubTable(tables.Table): + class Meta: + attrs = {'class':'table table-bordered table-condensed table-striped table-hover'} + model = Club + template_name = 'django_tables2/bootstrap.html' + fields= ('id','name','email') + row_attrs = {'class':'table-row', + 'data-href': lambda record: record.pk }