[PR #3890] [MERGED] Closes #3092: Refactor dcim/models.py #12682

Closed
opened 2025-12-29 22:23:01 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/3890
Author: @jeremystretch
Created: 1/10/2020
Status: Merged
Merged: 1/10/2020
Merged by: @jeremystretch

Base: develop-2.7Head: 3092-reorganize-models


📝 Commits (1)

  • ca13045 Closes #3092: Split DCIM models into separate files for easier management

📊 Changes

4 files changed (+1892 additions, -1789 deletions)

View changed files

📝 netbox/dcim/models/__init__.py (+469 -1788)
netbox/dcim/models/device_component_templates.py (+400 -0)
netbox/dcim/models/device_components.py (+1019 -0)
📝 netbox/dcim/tests/test_models.py (+4 -1)

📄 Description

Fixes: #3092

Move device components and component templates into separate files. Replaces dcim/models.py with a new structure:

dcim/
  models/
    __init__.py
      - Site
      - Rack
      - DeviceType
      - Device
      - ...
    device_components.py
      - ConsolePort
      - ConsoleServerPort
      - ...
    device_component_templates.py
      - ConsolePortTemplate
      - ConsoleServerPortTemplate
      - ...

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/3890 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 1/10/2020 **Status:** ✅ Merged **Merged:** 1/10/2020 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop-2.7` ← **Head:** `3092-reorganize-models` --- ### 📝 Commits (1) - [`ca13045`](https://github.com/netbox-community/netbox/commit/ca13045515b8038b3d15054962c853c5cd268188) Closes #3092: Split DCIM models into separate files for easier management ### 📊 Changes **4 files changed** (+1892 additions, -1789 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/models/__init__.py` (+469 -1788) ➕ `netbox/dcim/models/device_component_templates.py` (+400 -0) ➕ `netbox/dcim/models/device_components.py` (+1019 -0) 📝 `netbox/dcim/tests/test_models.py` (+4 -1) </details> ### 📄 Description ### Fixes: #3092 Move device components and component templates into separate files. Replaces `dcim/models.py` with a new structure: ``` dcim/ models/ __init__.py - Site - Rack - DeviceType - Device - ... device_components.py - ConsolePort - ConsoleServerPort - ... device_component_templates.py - ConsolePortTemplate - ConsoleServerPortTemplate - ... ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:23:01 +01:00
adam closed this issue 2025-12-29 22:23:01 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12682