Use English as source language for all user-visible strings, wrap them for translation and ship a German catalog. Add a test that keeps the README's NetBox range in sync with min_version/max_version. Co-Authored-By: Claude Opus 5.5 <[email protected]>
73 lines
2.0 KiB
Python
73 lines
2.0 KiB
Python
import django_tables2 as tables
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
from netbox.tables import NetBoxTable, ChoiceFieldColumn
|
|
from netbox_topology_views.models import CoordinateGroup, Coordinate, CircuitCoordinate, PowerPanelCoordinate, PowerFeedCoordinate
|
|
|
|
class CoordinateGroupListTable(NetBoxTable):
|
|
name = tables.Column(
|
|
linkify=True
|
|
)
|
|
devices = tables.Column(verbose_name=_('Devices'))
|
|
|
|
class Meta(NetBoxTable.Meta):
|
|
model = CoordinateGroup
|
|
fields = ('pk', 'id', 'name', 'description', 'devices')
|
|
default_columns = ('name', 'description', 'devices')
|
|
|
|
class CircuitCoordinateListTable(NetBoxTable):
|
|
group = tables.Column(
|
|
linkify=True
|
|
)
|
|
|
|
device = tables.Column(
|
|
linkify=True
|
|
)
|
|
|
|
class Meta(NetBoxTable.Meta):
|
|
model = CircuitCoordinate
|
|
fields = ('pk', 'id', 'group', 'device', 'x', 'y')
|
|
default_columns = ('id', 'group', 'device', 'x', 'y')
|
|
|
|
class PowerPanelCoordinateListTable(NetBoxTable):
|
|
group = tables.Column(
|
|
linkify=True
|
|
)
|
|
|
|
device = tables.Column(
|
|
linkify=True
|
|
)
|
|
|
|
class Meta(NetBoxTable.Meta):
|
|
model = PowerPanelCoordinate
|
|
fields = ('pk', 'id', 'group', 'device', 'x', 'y')
|
|
default_columns = ('id', 'group', 'device', 'x', 'y')
|
|
|
|
class PowerFeedCoordinateListTable(NetBoxTable):
|
|
group = tables.Column(
|
|
linkify=True
|
|
)
|
|
|
|
device = tables.Column(
|
|
linkify=True
|
|
)
|
|
|
|
class Meta(NetBoxTable.Meta):
|
|
model = PowerFeedCoordinate
|
|
fields = ('pk', 'id', 'group', 'device', 'x', 'y')
|
|
default_columns = ('id', 'group', 'device', 'x', 'y')
|
|
|
|
class CoordinateListTable(NetBoxTable):
|
|
group = tables.Column(
|
|
linkify=True
|
|
)
|
|
|
|
device = tables.Column(
|
|
linkify=True
|
|
)
|
|
|
|
class Meta(NetBoxTable.Meta):
|
|
model = Coordinate
|
|
fields = ('pk', 'id', 'group', 'device', 'x', 'y')
|
|
default_columns = ('id', 'group', 'device', 'x', 'y')
|