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

Conversation

mrhyks
Copy link
Contributor

@mrhyks mrhyks commented Jun 12, 2025

Fixes #66. Adds option to display device in interface view. It is not set as default column.

@@ -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'

instance_device = tables.Column(
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

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

@@ -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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show devices on Area view
3 participants