-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closes #6930: Add 'ID' column to object tables #7673
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
Merged
jeremystretch
merged 15 commits into
netbox-community:develop
from
rhyser9:6930_id_column
Nov 2, 2021
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ae9611a
netbox-community/netbox#6930: Add ID column to devices, device types,…
rhyser9 45542a4
netbox-community/netbox#6930: Add ID column to sites, racks, and tenants
rhyser9 a02851a
netbox-community/netbox#6930: Add ID column to power, providers, TODO…
rhyser9 fa56336
netbox-community/netbox#6930: Add ID column to virtualization tables
rhyser9 b75a872
netbox-community/netbox#6930: Add ID column to IPAM tables
rhyser9 61d2063
netbox-community/netbox#6930: Add ID column to 'extras' tables
rhyser9 02f2cf4
netbox-community/netbox#6930: Move ID column to BaseTable class
rhyser9 8aef9f3
netbox-community/netbox#6930: Don't linkify ID in device component te…
rhyser9 7b97b14
netbox-community/netbox#6930: Don't show ID column in interface/conso…
rhyser9 fdc9f1f
netbox-community/netbox#6930: Don't show ID column in device componen…
rhyser9 6d478d1
netbox-community/netbox#6930: Add ID column to ObjectJournal, DeviceI…
rhyser9 cc2501e
Exclude ID column from selected tables
rhyser9 3b36dd2
netbox-community/netbox#6930:revert default columns on ObjectChangeTa…
rhyser9 ceae4ed
netbox-community/netbox#6930: Add object ID to tagged objects table i…
rhyser9 e94d0b2
Merge branch 'develop' into 6930_id_column
jeremystretch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,6 +46,9 @@ class ManufacturerTable(BaseTable): | |
| class Meta(BaseTable.Meta): | ||
| model = Manufacturer | ||
| fields = ( | ||
| 'pk', 'id', 'name', 'devicetype_count', 'inventoryitem_count', 'platform_count', 'description', 'slug', 'actions', | ||
| ) | ||
| default_columns = ( | ||
| 'pk', 'name', 'devicetype_count', 'inventoryitem_count', 'platform_count', 'description', 'slug', 'actions', | ||
| ) | ||
|
|
||
|
|
@@ -76,7 +79,7 @@ class DeviceTypeTable(BaseTable): | |
| class Meta(BaseTable.Meta): | ||
| model = DeviceType | ||
| fields = ( | ||
| 'pk', 'model', 'manufacturer', 'slug', 'part_number', 'u_height', 'is_full_depth', 'subdevice_role', | ||
| 'pk', 'id', 'model', 'manufacturer', 'slug', 'part_number', 'u_height', 'is_full_depth', 'subdevice_role', | ||
| 'comments', 'instance_count', 'tags', | ||
| ) | ||
| default_columns = ( | ||
|
|
@@ -90,10 +93,16 @@ class Meta(BaseTable.Meta): | |
|
|
||
| class ComponentTemplateTable(BaseTable): | ||
| pk = ToggleColumn() | ||
| id = tables.Column( | ||
| verbose_name='ID' | ||
| ) | ||
| name = tables.Column( | ||
| order_by=('_name',) | ||
| ) | ||
|
|
||
| class Meta(BaseTable.Meta): | ||
| exclude = ('id', ) | ||
|
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exclude the |
||
|
|
||
| class ConsolePortTemplateTable(ComponentTemplateTable): | ||
| actions = ButtonsColumn( | ||
|
|
@@ -102,7 +111,7 @@ class ConsolePortTemplateTable(ComponentTemplateTable): | |
| return_url_extra='%23tab_consoleports' | ||
| ) | ||
|
|
||
| class Meta(BaseTable.Meta): | ||
| class Meta(ComponentTemplateTable.Meta): | ||
| model = ConsolePortTemplate | ||
| fields = ('pk', 'name', 'label', 'type', 'description', 'actions') | ||
| empty_text = "None" | ||
|
|
@@ -115,7 +124,7 @@ class ConsoleServerPortTemplateTable(ComponentTemplateTable): | |
| return_url_extra='%23tab_consoleserverports' | ||
| ) | ||
|
|
||
| class Meta(BaseTable.Meta): | ||
| class Meta(ComponentTemplateTable.Meta): | ||
| model = ConsoleServerPortTemplate | ||
| fields = ('pk', 'name', 'label', 'type', 'description', 'actions') | ||
| empty_text = "None" | ||
|
|
@@ -128,7 +137,7 @@ class PowerPortTemplateTable(ComponentTemplateTable): | |
| return_url_extra='%23tab_powerports' | ||
| ) | ||
|
|
||
| class Meta(BaseTable.Meta): | ||
| class Meta(ComponentTemplateTable.Meta): | ||
| model = PowerPortTemplate | ||
| fields = ('pk', 'name', 'label', 'type', 'maximum_draw', 'allocated_draw', 'description', 'actions') | ||
| empty_text = "None" | ||
|
|
@@ -141,7 +150,7 @@ class PowerOutletTemplateTable(ComponentTemplateTable): | |
| return_url_extra='%23tab_poweroutlets' | ||
| ) | ||
|
|
||
| class Meta(BaseTable.Meta): | ||
| class Meta(ComponentTemplateTable.Meta): | ||
| model = PowerOutletTemplate | ||
| fields = ('pk', 'name', 'label', 'type', 'power_port', 'feed_leg', 'description', 'actions') | ||
| empty_text = "None" | ||
|
|
@@ -157,7 +166,7 @@ class InterfaceTemplateTable(ComponentTemplateTable): | |
| return_url_extra='%23tab_interfaces' | ||
| ) | ||
|
|
||
| class Meta(BaseTable.Meta): | ||
| class Meta(ComponentTemplateTable.Meta): | ||
| model = InterfaceTemplate | ||
| fields = ('pk', 'name', 'label', 'mgmt_only', 'type', 'description', 'actions') | ||
| empty_text = "None" | ||
|
|
@@ -174,7 +183,7 @@ class FrontPortTemplateTable(ComponentTemplateTable): | |
| return_url_extra='%23tab_frontports' | ||
| ) | ||
|
|
||
| class Meta(BaseTable.Meta): | ||
| class Meta(ComponentTemplateTable.Meta): | ||
| model = FrontPortTemplate | ||
| fields = ('pk', 'name', 'label', 'type', 'color', 'rear_port', 'rear_port_position', 'description', 'actions') | ||
| empty_text = "None" | ||
|
|
@@ -188,7 +197,7 @@ class RearPortTemplateTable(ComponentTemplateTable): | |
| return_url_extra='%23tab_rearports' | ||
| ) | ||
|
|
||
| class Meta(BaseTable.Meta): | ||
| class Meta(ComponentTemplateTable.Meta): | ||
| model = RearPortTemplate | ||
| fields = ('pk', 'name', 'label', 'type', 'color', 'positions', 'description', 'actions') | ||
| empty_text = "None" | ||
|
|
@@ -201,7 +210,7 @@ class DeviceBayTemplateTable(ComponentTemplateTable): | |
| return_url_extra='%23tab_devicebays' | ||
| ) | ||
|
|
||
| class Meta(BaseTable.Meta): | ||
| class Meta(ComponentTemplateTable.Meta): | ||
| model = DeviceBayTemplate | ||
| fields = ('pk', 'name', 'label', 'description', 'actions') | ||
| empty_text = "None" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
un-linkify the
idcolumn, because device component templates don't have a detail page to link to. The device detail page errors without this because there's noget_absolute_urlmethod on the component template model.