[PR #13271] [MERGED] Closes #13269: Cache component template counts on device types #14143

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/13271
Author: @jeremystretch
Created: 7/25/2023
Status: Merged
Merged: 7/25/2023
Merged by: @jeremystretch

Base: featureHead: 13269-cache-devicetype-component-counts


📝 Commits (1)

  • cfe4285 Closes #13269: Cache component template counts on device types

📊 Changes

9 files changed (+233 additions, -26 deletions)

View changed files

📝 netbox/dcim/api/serializers.py (+19 -3)
📝 netbox/dcim/apps.py (+2 -2)
📝 netbox/dcim/migrations/0176_device_component_counters.py (+10 -2)
netbox/dcim/migrations/0177_devicetype_component_counters.py (+108 -0)
📝 netbox/dcim/migrations/0178_virtual_chassis_member_counter.py (+1 -1)
📝 netbox/dcim/models/device_component_templates.py (+2 -1)
📝 netbox/dcim/models/devices.py (+42 -0)
📝 netbox/dcim/tables/devicetypes.py (+39 -7)
📝 netbox/dcim/views.py (+10 -10)

📄 Description

Fixes: #13269

  • Add cached counter fields on DeviceType for all component template models
  • Provide a migration to automatically populate the counts for existing device types

🔄 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/13271 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 7/25/2023 **Status:** ✅ Merged **Merged:** 7/25/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `13269-cache-devicetype-component-counts` --- ### 📝 Commits (1) - [`cfe4285`](https://github.com/netbox-community/netbox/commit/cfe4285825d8ae948eb68f3746ad7bc40611d8a5) Closes #13269: Cache component template counts on device types ### 📊 Changes **9 files changed** (+233 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/api/serializers.py` (+19 -3) 📝 `netbox/dcim/apps.py` (+2 -2) 📝 `netbox/dcim/migrations/0176_device_component_counters.py` (+10 -2) ➕ `netbox/dcim/migrations/0177_devicetype_component_counters.py` (+108 -0) 📝 `netbox/dcim/migrations/0178_virtual_chassis_member_counter.py` (+1 -1) 📝 `netbox/dcim/models/device_component_templates.py` (+2 -1) 📝 `netbox/dcim/models/devices.py` (+42 -0) 📝 `netbox/dcim/tables/devicetypes.py` (+39 -7) 📝 `netbox/dcim/views.py` (+10 -10) </details> ### 📄 Description ### Fixes: #13269 - Add cached counter fields on DeviceType for all component template models - Provide a migration to automatically populate the counts for existing device types --- <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 23:22:47 +01:00
adam closed this issue 2025-12-29 23:22:47 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14143