From ddb8dc2bba421f2b5b7e5b65d7f17993d631fcaa Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sun, 23 Feb 2020 12:59:20 +0100 Subject: [PATCH] remove all the table templates with a single settings option --- backups/tables.py | 1 - computers/tables.py | 1 - customers/tables.py | 1 - devices/tables.py | 3 --- licenses/tables.py | 2 -- nets/tables.py | 2 -- network_inventory/settings/base.py | 2 ++ users/tables.py | 1 - 8 files changed, 2 insertions(+), 11 deletions(-) diff --git a/backups/tables.py b/backups/tables.py index 4b3970b..429c3d2 100644 --- a/backups/tables.py +++ b/backups/tables.py @@ -11,6 +11,5 @@ class BackupsTable(CoreTable): computer = tables.Column('Computer', linkify=True) target_device = tables.ManyToManyColumn(linkify_item=True) - template_name = 'django_tables2/semantic.html' class Meta(CoreTable.Meta): model = Backup diff --git a/computers/tables.py b/computers/tables.py index 5b066d1..49422ad 100644 --- a/computers/tables.py +++ b/computers/tables.py @@ -14,6 +14,5 @@ class ComputersTable(CoreTable): installation_date = tables.Column() os = tables.Column() - template_name = 'django_tables2/semantic.html' class Meta(CoreTable.Meta): pass diff --git a/customers/tables.py b/customers/tables.py index a2ff203..9519dca 100644 --- a/customers/tables.py +++ b/customers/tables.py @@ -23,6 +23,5 @@ class CustomersTable(CoreTable): users = tables.LinkColumn('users', text='Users', args=[A('pk')], orderable=False) - template_name = 'django_tables2/semantic.html' class Meta(CoreTable.Meta): pass diff --git a/devices/tables.py b/devices/tables.py index 98b8317..483ce3c 100644 --- a/devices/tables.py +++ b/devices/tables.py @@ -11,7 +11,6 @@ class DevicesTable(CoreTable): id = tables.Column(visible=False) name = tables.Column('Device', linkify=True) - template_name = 'django_tables2/semantic.html' class Meta(CoreTable.Meta): model = Device @@ -20,7 +19,6 @@ class ConnectedDevicesTable(CoreTable): id = tables.Column(visible=False) name = tables.Column('ConnectedDevice', linkify=True) - template_name = 'django_tables2/semantic.html' class Meta(CoreTable.Meta): model = ConnectedDevice @@ -32,6 +30,5 @@ class WarrantiesTable(CoreTable): valid_until = tables.Column() warranty_type = tables.Column() - template_name = 'django_tables2/semantic.html' class Meta(CoreTable.Meta): pass diff --git a/licenses/tables.py b/licenses/tables.py index 987be6c..53e8ee6 100644 --- a/licenses/tables.py +++ b/licenses/tables.py @@ -13,7 +13,6 @@ class UserLicensesTable(CoreTable): used_licenses = tables.Column() user = tables.ManyToManyColumn(linkify_item=True) - template_name = 'django_tables2/semantic.html' class Meta(CoreTable.Meta): model = UserLicense @@ -25,6 +24,5 @@ class ComputerLicensesTable(CoreTable): used_licenses = tables.Column() computer = tables.ManyToManyColumn(linkify_item=True) - template_name = 'django_tables2/semantic.html' class Meta(CoreTable.Meta): model = ComputerLicense diff --git a/nets/tables.py b/nets/tables.py index 1d443fc..d2a56cb 100644 --- a/nets/tables.py +++ b/nets/tables.py @@ -11,7 +11,6 @@ class NetsTable(CoreTable): name = tables.Column('Net', linkify=True) customer = tables.Column('Customer', linkify=True) - template_name = 'django_tables2/semantic.html' class Meta(CoreTable.Meta): model = Net @@ -21,6 +20,5 @@ class NetDetailTable(CoreTable): ip = tables.Column() net = tables.Column(visible=False) - template_name = 'django_tables2/semantic.html' class Meta(CoreTable.Meta): model = DeviceInNet diff --git a/network_inventory/settings/base.py b/network_inventory/settings/base.py index bc08d9d..d896ef6 100644 --- a/network_inventory/settings/base.py +++ b/network_inventory/settings/base.py @@ -119,3 +119,5 @@ USE_TZ = True # https://docs.djangoproject.com/en/2.0/howto/static-files/ STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, "static") + +DJANGO_TABLES2_TEMPLATE = "django_tables2/bootstrap4.html" diff --git a/users/tables.py b/users/tables.py index b47a04a..d6d9078 100644 --- a/users/tables.py +++ b/users/tables.py @@ -12,6 +12,5 @@ class UsersTable(CoreTable): ad_groups = tables.ManyToManyColumn() mail_groups = tables.ManyToManyColumn() - template_name = 'django_tables2/semantic.html' class Meta(CoreTable.Meta): model = User