Skip to content

Expose Inventory Items Parent/Child hierarchy in UI #1692

@candlerb

Description

@candlerb

Issue type

[X] Feature request
[ ] Bug report
[ ] Documentation

Environment

  • Python version: 3.5.2
  • NetBox version: 2.2.4

Description

groups thread

The dcim_inventoryitem table has a "parent_id" field which is self-referential:

    "dcim_inventoryitem_parent_id_7ebcd457_fk_dcim_inventoryitem_id" FOREIGN KEY (parent_id) REFERENCES dcim_inventoryitem(id) DEFERRABLE INITIALLY DEFERRED

and there is some support for rendering such items hierarchically:

{% for item in item.child_items.all %}
    {% with template_name='dcim/inc/inventoryitem.html' indent=indent|add:20 %}
        {% include template_name %}
    {% endwith %}
{% endfor %}

But there is currently no way to set the inventory item parent/child relationship in the GUI.

Implementing this could be as simple as a 'set parent' drop-down list (restricted to inventory items on the current device); or it could change the data model to MPTT, like Region.

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions