Add Tenant Group column to tables #6637

Closed
opened 2025-12-29 19:43:22 +01:00 by adam · 3 comments
Owner

Originally created by @hagbarddenstore on GitHub (Jul 8, 2022).

Originally assigned to: @hagbarddenstore on GitHub.

NetBox version

v3.2.5

Feature type

New functionality

Proposed functionality

Add a new column to display the Tenant Group of the records Tenant.

This would require a new column tenant_group on all tables which also has the tenant column.

It would not be a default column.

It would also require (For performance reasons) that the tenant.group is prefetched in all views.

Use case

Our use case is that we represent a customer as a Tenant Group and theirs different contracts as Tenants. This means that we end up with a contract number as the Tenant name, which makes it a bit hard to figure out at a glance which customer a thing belongs to.

If we could add the Tenant Group (Which contains the customer name) to the table, it would solve our user experience issue.

Database changes

None

External dependencies

None

Originally created by @hagbarddenstore on GitHub (Jul 8, 2022). Originally assigned to: @hagbarddenstore on GitHub. ### NetBox version v3.2.5 ### Feature type New functionality ### Proposed functionality Add a new column to display the Tenant Group of the records Tenant. This would require a new column `tenant_group` on all tables which also has the `tenant` column. It would not be a default column. It would also require (For performance reasons) that the tenant.group is prefetched in all views. ### Use case Our use case is that we represent a customer as a Tenant Group and theirs different contracts as Tenants. This means that we end up with a contract number as the Tenant name, which makes it a bit hard to figure out at a glance which customer a thing belongs to. If we could add the Tenant Group (Which contains the customer name) to the table, it would solve our user experience issue. ### Database changes None ### External dependencies None
adam added the status: acceptedtype: feature labels 2025-12-29 19:43:22 +01:00
adam closed this issue 2025-12-29 19:43:23 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 8, 2022):

This should probably be done using a mixin class to define both the tenant and tenant_group columns for each of the relevant tables. (tenant_group can be a regular column with linkify=True.)

@jeremystretch commented on GitHub (Jul 8, 2022): This should probably be done using a mixin class to define both the `tenant` and `tenant_group` columns for each of the relevant tables. (`tenant_group` can be a regular column with `linkify=True`.)
Author
Owner

@hagbarddenstore commented on GitHub (Jul 8, 2022):

This should probably be done using a mixin class to define both the tenant and tenant_group columns for each of the relevant tables. (tenant_group can be a regular column with linkify=True.)

I agree, that was actually the first thing I looked for.

Is there a clever way of adding the column to the Meta.fields list or should that be up to the table class to define?

Btw, I can implement this FR.

@hagbarddenstore commented on GitHub (Jul 8, 2022): > This should probably be done using a mixin class to define both the `tenant` and `tenant_group` columns for each of the relevant tables. (`tenant_group` can be a regular column with `linkify=True`.) I agree, that was actually the first thing I looked for. Is there a clever way of adding the column to the `Meta.fields` list or should that be up to the table class to define? Btw, I can implement this FR.
Author
Owner

@jeremystretch commented on GitHub (Jul 8, 2022):

Is there a clever way of adding the column to the Meta.fields list or should that be up to the table class to define?

We've been doing it explicitly for each class, which admittedly isn't ideal. I just haven't ever looked for a more elegant solution.

@jeremystretch commented on GitHub (Jul 8, 2022): > Is there a clever way of adding the column to the Meta.fields list or should that be up to the table class to define? We've been doing it explicitly for each class, which admittedly isn't ideal. I just haven't ever looked for a more elegant solution.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6637