network_inventory/inventory/tables.py
2020-01-10 00:01:06 +01:00

56 lines
1.6 KiB
Python

import django_tables2 as tables
from .models import Backup
from .models import ComputerLicense
from .models import UserLicense
class ComputersTable(tables.Table):
name = tables.Column('Computer', linkify=True)
description = tables.Column()
serialnumber = tables.Column()
owner = tables.Column()
manufacturer = tables.Column()
location = tables.Column()
user = tables.Column('User', linkify=True)
installation_date = tables.Column()
os = tables.Column()
class Meta:
template_name = 'django_tables2/semantic.html'
class BackupsTable(tables.Table):
id = tables.Column(visible=False)
name = tables.Column('Backup', linkify=True)
computer = tables.Column('Computer', linkify=True)
target_device = tables.ManyToManyColumn(linkify_item=True)
class Meta:
template_name = 'django_tables2/semantic.html'
model = Backup
class UserLicensesTable(tables.Table):
id = tables.Column(visible=False)
license_ptr = tables.Column(visible=False)
customer = tables.Column('Customer', linkify=True)
used_licenses = tables.Column()
user = tables.ManyToManyColumn(linkify_item=True)
class Meta:
template_name = 'django_tables2/semantic.html'
model = UserLicense
class ComputerLicensesTable(tables.Table):
id = tables.Column(visible=False)
license_ptr = tables.Column(visible=False)
customer = tables.Column('Customer', linkify=True)
used_licenses = tables.Column()
computer = tables.ManyToManyColumn(linkify_item=True)
class Meta:
template_name = 'django_tables2/semantic.html'
model = ComputerLicense