Improve handing of "pattern" fields during object creation #5810

Closed
opened 2025-12-29 19:33:00 +01:00 by adam · 1 comment
Owner

Originally created by @jeremystretch on GitHub (Dec 20, 2021).

Originally assigned to: @jeremystretch on GitHub.

Proposed Changes

Improve the handling of fields which return a set of multiple values derived from a given pattern, i.e. ExpandableNameField and ExpandableIPAddressField. These are currently handled explicitly as an anti-pattern e.g. under ComponentCreateView.

I still need to do some research to determine our options, but I wanted to get this initiative documented.

Justification

The way these "expanded" fields are handled currently requires intervention within the view logic, and does not scale well to include additional implementations, such as the expansion of module bay positions under #7844.

Originally created by @jeremystretch on GitHub (Dec 20, 2021). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes Improve the handling of fields which return a set of multiple values derived from a given pattern, i.e. ExpandableNameField and ExpandableIPAddressField. These are currently handled explicitly as an anti-pattern e.g. under ComponentCreateView. I still need to do some research to determine our options, but I wanted to get this initiative documented. ### Justification The way these "expanded" fields are handled currently requires intervention within the view logic, and does not scale well to include additional implementations, such as the expansion of module bay positions under #7844.
adam added the type: housekeeping label 2025-12-29 19:33:00 +01:00
adam closed this issue 2025-12-29 19:33:00 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 28, 2021):

I ended up refactoring most of the device component creation logic under #7846. This is no longer needed.

@jeremystretch commented on GitHub (Dec 28, 2021): I ended up refactoring most of the device component creation logic under #7846. This is no longer needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5810