Add Location, Site, Region columns in PrefixTable #95

Closed
opened 2026-04-05 16:21:37 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @matthew-242 on 3/24/2026

NetBox version

v4.5.1

Feature type

New functionality

Proposed functionality

Add extra columns to the prefix table to show location, site, site group and region in addition to only scope.

To my understanding this should be relatively trivial to implement as the fields are already cached in the CachedScopeMixin for filtering usecases. Because of this I would expect we could just add something like this to the PrefixTable class (as well as updating fields in the Meta class):

site = tables.Column(
    accessor='_site',
    linkify=True,
    verbose_name=_('Site'),
    order_by=('_site__name')
)

Obviously there would be similar for region, site group and location.

Also note I am happy to raise a PR for this if it is accepted.

Use case

When you have a relatively small number of locations etc, it is relatively trivial to see them in the web interface and intrinsically know which site/site-group/region they are part of, however as the number of locations grows (or if you have less experienced users) it can be challenging to know at glance which site/site-group/region a prefix is from when all you see is the "location" in the scope. (Note while I am talking about Location here as the issue is most pronounced, the same logic applies for Sites etc)

By adding the ability to have these extra fields it enables a Netbox user to at a glance see exactly where a prefix is configured, or easily understand how supernets have been broken down across regions/sites/locations etc all in one view.

This seems like it adds a lot of value to Netbox users, with minimal extra code complexity as the data is already cached for filtering.

Database changes

None

External dependencies

None

*Originally created by @matthew-242 on 3/24/2026* ### NetBox version v4.5.1 ### Feature type New functionality ### Proposed functionality Add extra columns to the prefix table to show location, site, site group and region in addition to only scope. To my understanding this should be relatively trivial to implement as the fields are already cached in the CachedScopeMixin for filtering usecases. Because of this I would expect we could just add something like this to the PrefixTable class (as well as updating fields in the Meta class): ``` site = tables.Column( accessor='_site', linkify=True, verbose_name=_('Site'), order_by=('_site__name') ) ``` Obviously there would be similar for region, site group and location. Also note I am happy to raise a PR for this if it is accepted. ### Use case When you have a relatively small number of locations etc, it is relatively trivial to see them in the web interface and intrinsically know which site/site-group/region they are part of, however as the number of locations grows (or if you have less experienced users) it can be challenging to know at glance which site/site-group/region a prefix is from when all you see is the "location" in the scope. (Note while I am talking about Location here as the issue is most pronounced, the same logic applies for Sites etc) By adding the ability to have these extra fields it enables a Netbox user to at a glance see exactly where a prefix is configured, or easily understand how supernets have been broken down across regions/sites/locations etc all in one view. This seems like it adds a lot of value to Netbox users, with minimal extra code complexity as the data is already cached for filtering. ### Database changes None ### External dependencies None
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#95