class LocationTable(BaseTable): pk = ToggleColumn() name = MPTTColumn( linkify=True ) site = tables.Column( linkify=True ) rack_count = LinkedCountColumn( viewname='dcim:rack_list', url_params={'location_id': 'pk'}, verbose_name='Racks' ) device_count = LinkedCountColumn( viewname='dcim:device_list', url_params={'location_id': 'pk'}, verbose_name='Devices' ) actions = ButtonsColumn( model=Location, prepend_template=LOCATION_ELEVATIONS ) class Meta(BaseTable.Meta): model = Location fields = ('pk', 'name', 'site', 'rack_count', 'device_count', 'description', 'slug', 'actions') default_columns = ('pk', 'name', 'site', 'rack_count', 'device_count', 'description', 'actions')
class TenantGroupTable(BaseTable): pk = ToggleColumn() name = MPTTColumn(linkify=True) tenant_count = LinkedCountColumn(viewname='tenancy:tenant_list', url_params={'group_id': 'pk'}, verbose_name='Tenants') tags = TagColumn(url_name='tenancy:tenantgroup_list') actions = ButtonsColumn(TenantGroup) class Meta(BaseTable.Meta): model = TenantGroup fields = ( 'pk', 'id', 'name', 'tenant_count', 'description', 'slug', 'tags', 'actions', 'created', 'last_updated', ) default_columns = ('pk', 'name', 'tenant_count', 'description', 'actions')
class SiteGroupTable(BaseTable): pk = ToggleColumn() name = MPTTColumn(linkify=True) site_count = LinkedCountColumn(viewname='dcim:site_list', url_params={'group_id': 'pk'}, verbose_name='Sites') actions = ButtonsColumn(SiteGroup) class Meta(BaseTable.Meta): model = SiteGroup fields = ('pk', 'name', 'slug', 'site_count', 'description', 'actions') default_columns = ('pk', 'name', 'site_count', 'description', 'actions')
class RegionTable(BaseTable): pk = ToggleColumn() name = MPTTColumn(linkify=True) site_count = LinkedCountColumn(viewname='dcim:site_list', url_params={'region_id': 'pk'}, verbose_name='Sites') tags = TagColumn(url_name='dcim:region_list') actions = ButtonsColumn(Region) class Meta(BaseTable.Meta): model = Region fields = ('pk', 'id', 'name', 'slug', 'site_count', 'description', 'tags', 'actions', 'created', 'last_updated') default_columns = ('pk', 'name', 'site_count', 'description', 'actions')
class WirelessLANGroupTable(BaseTable): pk = ToggleColumn() name = MPTTColumn( linkify=True ) wirelesslan_count = LinkedCountColumn( viewname='wireless:wirelesslan_list', url_params={'group_id': 'pk'}, verbose_name='Wireless LANs' ) tags = TagColumn( url_name='wireless:wirelesslangroup_list' ) actions = ButtonsColumn(WirelessLANGroup) class Meta(BaseTable.Meta): model = WirelessLANGroup fields = ( 'pk', 'name', 'wirelesslan_count', 'description', 'slug', 'tags', 'actions', 'created', 'last_updated', ) default_columns = ('pk', 'name', 'wirelesslan_count', 'description', 'actions')