-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add list view for device components #3719
Add list view for device components #3719
Conversation
Are we good, as a start, with the generic columns (parent/device, name, type, description, cable)? |
@DanSheps I think it is fine for all models except interface. The interface model is just to core to the NetBox mission that I think it justifies overriding the table definition with more relevant fields. But if that becomes a line in the sand blocking this from moving forward, I will concede. |
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.
Excellent work! Thanks for doing all this heavy lifting. Just had a few comments/questions regarding cleanup/consistency.
netbox/dcim/tables.py
Outdated
component_type = 'Interfaces' | ||
parent = tables.LinkColumn(order_by=('device', 'virtual_machine')) | ||
|
||
class Meta(InterfaceTable.Meta, DeviceComponentDetailTable.Meta): |
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.
Is there a need to inherit from other Meta classes here, since we're setting the parameters anyway? If there is, inheritance order should be consistent with the other component tables.
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.
I believe we are taking the model from some and the columns from another, but for this one most likely not.
I believe I set it mostly for a "in the future case" and to maintain consistency with the other models but it looks like I goofed on the ordering.
|
||
class Meta(BaseTable.Meta): | ||
order_by = ('device', 'name') | ||
fields = ('pk', 'device', 'name', 'type', 'description', 'cable') |
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.
I'd recommend removing type
from this table and adding it only to the tables for models where it's a field (similar to how we're handling 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.
I have adjusted Interface and DeviceBay to instead not inherit the Component meta, as those are the only ones that will have a differing field list.
What other fields do you think should be added? |
Fixes: #3564