import django_tables2 as tables from ipam.tables import AnnotatedIPAddressTable from utilities.tables import register_table_column device_or_vm = tables.Column( accessor="assigned_object__parent_object", linkify=True, orderable=False, verbose_name="Gerät / VM", empty_values=(), ) register_table_column(device_or_vm, "device_or_vm", AnnotatedIPAddressTable) # Registered columns are selectable but not displayed by default. The annotated # table is used specifically by Prefix -> IP Addresses, where this information # should be visible immediately. if "device_or_vm" not in AnnotatedIPAddressTable.Meta.default_columns: AnnotatedIPAddressTable.Meta.default_columns = ( *AnnotatedIPAddressTable.Meta.default_columns, "device_or_vm", )