[PR #13270] [MERGED] Closes #10197: Add a cached counter field for virtual chassis members #14141

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

📋 Pull Request Information

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

Base: featureHead: 10197-cache-vc-member-counts


📝 Commits (1)

  • ff8909d Closes #10197: Add a cached counter field for virtual chassis members

📊 Changes

7 files changed (+60 additions, -10 deletions)

View changed files

📝 netbox/dcim/api/serializers.py (+3 -1)
📝 netbox/dcim/api/views.py (+1 -3)
📝 netbox/dcim/apps.py (+2 -2)
netbox/dcim/migrations/0177_virtual_chassis_member_counter.py (+35 -0)
📝 netbox/dcim/models/devices.py (+8 -1)
📝 netbox/dcim/views.py (+1 -3)
📝 netbox/templates/dcim/virtualchassis.html (+10 -0)

📄 Description

Fixes: #10197

  • Add a member_count CounterCacheField on VirtualChassis
  • Provide an automatic migration to update the field values on existing VCs
  • Remove the queryset annotations previously used to report on this number

🔄 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/13270 **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:** `10197-cache-vc-member-counts` --- ### 📝 Commits (1) - [`ff8909d`](https://github.com/netbox-community/netbox/commit/ff8909d44fddfe09d472f5e9c3be9597ddedb1d2) Closes #10197: Add a cached counter field for virtual chassis members ### 📊 Changes **7 files changed** (+60 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/api/serializers.py` (+3 -1) 📝 `netbox/dcim/api/views.py` (+1 -3) 📝 `netbox/dcim/apps.py` (+2 -2) ➕ `netbox/dcim/migrations/0177_virtual_chassis_member_counter.py` (+35 -0) 📝 `netbox/dcim/models/devices.py` (+8 -1) 📝 `netbox/dcim/views.py` (+1 -3) 📝 `netbox/templates/dcim/virtualchassis.html` (+10 -0) </details> ### 📄 Description ### Fixes: #10197 - Add a `member_count` CounterCacheField on VirtualChassis - Provide an automatic migration to update the field values on existing VCs - Remove the queryset annotations previously used to report on this number --- <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:46 +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#14141