Archived
Use English source strings wrapped for gettext, ship a German catalogue, and check that README and package metadata match the PluginConfig. Co-Authored-By: Claude Opus 5.5 <[email protected]>
27 lines
927 B
Python
27 lines
927 B
Python
import django_tables2 as tables
|
|
from django.utils.translation import gettext_lazy as _
|
|
from ipam.tables import IPAddressTable
|
|
from utilities.tables import register_table_column
|
|
|
|
|
|
device_or_vm = tables.Column(
|
|
accessor="assigned_object__parent_object",
|
|
linkify=True,
|
|
orderable=False,
|
|
verbose_name=_("Device / VM"),
|
|
empty_values=(),
|
|
)
|
|
|
|
register_table_column(device_or_vm, "device_or_vm", IPAddressTable)
|
|
|
|
# Registered columns are selectable but not displayed by default. The annotated
|
|
# table is used by IP Range -> IP Addresses, where this information should be
|
|
# visible immediately.
|
|
if "device_or_vm" not in IPAddressTable.Meta.default_columns:
|
|
IPAddressTable.Meta.default_columns = (
|
|
*IPAddressTable.Meta.default_columns,
|
|
"device_or_vm",
|
|
)
|
|
if "device_or_vm" not in IPAddressTable.exempt_columns:
|
|
IPAddressTable.exempt_columns = (*IPAddressTable.exempt_columns, "device_or_vm")
|