Skip to content

show device in interface view #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion netbox_routing/tables/ospf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,17 @@ class Meta(NetBoxTable.Meta):
default_columns = ('pk', 'id', 'area_id')



Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Will fail ruff linting

class OSPFInterfaceTable(NetBoxTable):
instance = tables.Column(
verbose_name=_('Instance'),
linkify=True
)
instance_device = tables.Column(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
instance_device = tables.Column(
device = tables.Column(

Rename to device to better follow convention within the rest of the app

verbose_name=_('Device'),
linkify=True,
accessor='instance.device',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
accessor='instance.device',
accessor='instance__device',

Per documentation, accessors should be double underscore

)
area = tables.Column(
verbose_name=_('Area'),
linkify=True
Expand All @@ -43,6 +49,6 @@ class OSPFInterfaceTable(NetBoxTable):
class Meta(NetBoxTable.Meta):
model = OSPFInterface
fields = (
'pk', 'id', 'instance', 'area', 'interface', 'passive', 'priority', 'bfd', 'authentication', 'passphrase'
'pk', 'id', 'instance', 'instance_device', 'area', 'interface', 'passive', 'priority', 'bfd', 'authentication', 'passphrase'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'pk', 'id', 'instance', 'instance_device', 'area', 'interface', 'passive', 'priority', 'bfd', 'authentication', 'passphrase'
'pk', 'id', 'instance', 'device', 'area', 'interface', 'passive', 'priority', 'bfd', 'authentication', 'passphrase'

)
default_columns = ('pk', 'id', 'instance', 'area', 'interface', 'passive')
Loading