Move Device and DeviceType compontent models out of models.py #2533

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

Originally created by @jeremystretch on GitHub (Apr 19, 2019).

Originally assigned to: @jeremystretch on GitHub.

Proposed Changes

dcim/models.py has gotten pretty cluttered: It currently holds over 60 models. I'd like to reorganize the models into three files under dcim/models/:

  • ComponentTemplateModels
  • ComponentModels
  • Everything else

These will all be imported via dcim/models/__init__.py.

Justification

This should reduce clutter and make it easier to jump around among models when developing.

Originally created by @jeremystretch on GitHub (Apr 19, 2019). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes `dcim/models.py` has gotten pretty cluttered: It currently holds over 60 models. I'd like to reorganize the models into three files under `dcim/models/`: * ComponentTemplateModels * ComponentModels * Everything else These will all be imported via `dcim/models/__init__.py`. ### Justification This should reduce clutter and make it easier to jump around among models when developing.
adam added the status: acceptedtype: housekeeping labels 2025-12-29 18:19:44 +01:00
adam closed this issue 2025-12-29 18:19:44 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 27, 2019):

@lampwins IIRC we briefly discussed the possibility of adopting a new models/ approach for all apps, not just DCIM. I suppose all base models would go in models/__init__.py and other stuff (like device components) would go in e.g. models/components.py. Do you think that makes sense?

@jeremystretch commented on GitHub (May 27, 2019): @lampwins IIRC we briefly discussed the possibility of adopting a new `models/` approach for _all_ apps, not just DCIM. I suppose all base models would go in `models/__init__.py` and other stuff (like device components) would go in e.g. `models/components.py`. Do you think that makes sense?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2533