move code to django tables

This commit is contained in:
2019-02-09 21:57:30 +01:00
parent 456917499a
commit c99c3a45d4
3 changed files with 34 additions and 30 deletions

22
billard/tables.py Normal file
View File

@@ -0,0 +1,22 @@
import django_tables2 as tables
from .models import Location
class LocationTable(tables.Table):
code = tables.TemplateColumn(template_name='billard/tc_location_detail.html')
class Meta:
model = Location
fields = ('code', 'name', 'street', 'plz', 'city')
orderable = False
class LocationAccountingTable(tables.Table):
code = tables.TemplateColumn(template_name='billard/tc_location_detail.html')
accounting = tables.TemplateColumn(template_name='billard/tc_accounting_detail.html')
class Meta:
model = Location
fields = ('code', 'name', 'street', 'plz', 'city', 'accounting')
orderable = False