Convert InventoryItem's parent field to an MPTTField #1519

Closed
opened 2025-12-29 16:32:38 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Jan 30, 2018).

Originally assigned to: @jeremystretch on GitHub.

Issue type

[x] Feature request
[ ] Bug report
[ ] Documentation

Environment

  • Python version: 3.5.2
  • NetBox version: 2.2.8

Description

The parent field of an InventoryItem is used to arrange items hierarchically within a Device. For example:

- FPC 0
    - PIC 0
        - Xvcr 0

Currently, the parent field is a recursive ForeignKey, which does not allow for intelligent hierarchical ordering. We can change this to an MPTTField (like on the Region model) to greatly improve ordering and allow for more efficient queries.

Originally created by @jeremystretch on GitHub (Jan 30, 2018). Originally assigned to: @jeremystretch on GitHub. ### Issue type [x] Feature request <!-- An enhancement of existing functionality --> [ ] Bug report <!-- Unexpected or erroneous behavior --> [ ] Documentation <!-- A modification to the documentation --> ### Environment * Python version: 3.5.2 * NetBox version: 2.2.8 ### Description The `parent` field of an InventoryItem is used to arrange items hierarchically within a Device. For example: ``` - FPC 0 - PIC 0 - Xvcr 0 ``` Currently, the `parent` field is a recursive ForeignKey, which does not allow for intelligent hierarchical ordering. We can change this to an MPTTField (like on the Region model) to greatly improve ordering and allow for more efficient queries.
adam added the status: acceptedtype: housekeeping labels 2025-12-29 16:32:38 +01:00
adam closed this issue 2025-12-29 16:32:39 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1519