Skip to content

Commit

Permalink
adds site column to power feeds #13743
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi1693 committed Nov 8, 2023
1 parent 22e474f commit a09bc45
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions netbox/dcim/tables/power.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ class PowerFeedTable(TenancyColumnsMixin, CableTerminationTable):
linkify=True,
verbose_name=_('Tenant')
)
site = tables.TemplateColumn(
template_code='''{% if record.rack %}{{ record.rack.site|linkify }}{% else %}—{% endif %}''',
verbose_name=_('Site'),
)
comments = columns.MarkdownColumn(
verbose_name=_('Comments'),
)
Expand All @@ -97,9 +101,9 @@ class PowerFeedTable(TenancyColumnsMixin, CableTerminationTable):
class Meta(NetBoxTable.Meta):
model = PowerFeed
fields = (
'pk', 'id', 'name', 'power_panel', 'rack', 'status', 'type', 'supply', 'voltage', 'amperage', 'phase',
'max_utilization', 'mark_connected', 'cable', 'cable_color', 'link_peer', 'available_power', 'tenant',
'tenant_group', 'description', 'comments', 'tags', 'created', 'last_updated',
'pk', 'id', 'name', 'power_panel', 'site', 'rack', 'status', 'type', 'supply', 'voltage', 'amperage',
'phase', 'max_utilization', 'mark_connected', 'cable', 'cable_color', 'link_peer', 'available_power',
'tenant', 'tenant_group', 'description', 'comments', 'tags', 'created', 'last_updated',
)
default_columns = (
'pk', 'name', 'power_panel', 'rack', 'status', 'type', 'supply', 'voltage', 'amperage', 'phase', 'cable',
Expand Down

0 comments on commit a09bc45

Please sign in to comment.