Table Configuration doesn't respect a Tables .fields #6270

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

Originally created by @hagbarddenstore on GitHub (Mar 29, 2022).

NetBox version

v3.1.10

Python version

3.9

Steps to Reproduce

  1. Go to the Interfaces tab on a Virtual Machine which has 1 or more interfaces.
  2. Click the "Configure Table" button.
  3. Add the Virtual Machine column.

Expected Behavior

The Virtual Machine column shouldn't be available in the Configure Table dialog, since the table used explicitly removes that column from the parent table.

Observed Behavior

The Virtual Machine column is present in the Configure Table dialog and can be successfully added to the table.

Originally created by @hagbarddenstore on GitHub (Mar 29, 2022). ### NetBox version v3.1.10 ### Python version 3.9 ### Steps to Reproduce 1. Go to the Interfaces tab on a Virtual Machine which has 1 or more interfaces. 2. Click the "Configure Table" button. 3. Add the Virtual Machine column. ### Expected Behavior The Virtual Machine column shouldn't be available in the Configure Table dialog, since the table used explicitly removes that column from the parent table. ### Observed Behavior The Virtual Machine column is present in the Configure Table dialog and can be successfully added to the table.
adam added the type: bugstatus: needs ownerpending closure labels 2025-12-29 19:38:47 +01:00
adam closed this issue 2025-12-29 19:38:47 +01:00
Author
Owner

@hagbarddenstore commented on GitHub (Mar 29, 2022):

The issue is that the Configure Table dialog uses the defined fields on the table class rather than looking at the table class meta class fields property.

Example:

class ParentTable(BaseTable):
    parent_field = tables.Column(verbose_name='Parent Field')

    class Meta(BaseTable.Meta):
        fields = ('parent_field',)

class ChildTable(ParentTable):
    child_field = tables.Column(verbose_name='Child Field')

    class Meta(ParentTable.Meta):
        fields = ('child_field',)

Given this structure, the Configure Table should only show the child_field when rendering the configuration for the ChildTable table.

Instead it looks at the defined fields, thus displays both the parent_field and the child_field.

@hagbarddenstore commented on GitHub (Mar 29, 2022): The issue is that the Configure Table dialog uses the defined fields on the table class rather than looking at the table class meta class fields property. Example: ``` class ParentTable(BaseTable): parent_field = tables.Column(verbose_name='Parent Field') class Meta(BaseTable.Meta): fields = ('parent_field',) class ChildTable(ParentTable): child_field = tables.Column(verbose_name='Child Field') class Meta(ParentTable.Meta): fields = ('child_field',) ``` Given this structure, the Configure Table should only show the `child_field` when rendering the configuration for the `ChildTable` table. Instead it looks at the defined fields, thus displays both the `parent_field` and the `child_field`.
Author
Owner

@github-actions[bot] commented on GitHub (May 30, 2022):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@github-actions[bot] commented on GitHub (May 30, 2022): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Jun 29, 2022):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Jun 29, 2022): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6270