-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
base: main
Are you sure you want to change the base?
Conversation
@@ -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' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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') | |||
|
|||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fail ruff linting
Fixes #66. Adds option to display device in interface view. It is not set as default column.