[PR #18583] [CLOSED] Fixes: #17976 DeviceType_Count on Manufacturer #15382

Closed
opened 2025-12-30 00:21:37 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/18583
Author: @renatoalmeidaoliveira
Created: 2/6/2025
Status: Closed

Base: mainHead: 17976-device_type_count_serializer


📝 Commits (6)

  • 00073af Change get_prefetches_for_serializer to annotate nested serializers
  • 5ea85b4 fix typo
  • 53e8da6 refactor get_prefetches_for_serializer
  • 603253d Removed prefetch for model fields, since its a Serializer and add for tags
  • 68d9c39 Generalize tags use case
  • 603c269 Add get_annotations_for_subfields and remove recursion

📊 Changes

1 file changed (+20 additions, -5 deletions)

View changed files

📝 netbox/utilities/api.py (+20 -5)

📄 Description

Fixes: #17976 DeviceType_Count on Manufacturer

  • Changed get_prefetches_for_serializer to support nested serializers
  • For each nested field select all RelatedObjectCountField fields and create a Prefetch with the correct annotation

🔄 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/18583 **Author:** [@renatoalmeidaoliveira](https://github.com/renatoalmeidaoliveira) **Created:** 2/6/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `17976-device_type_count_serializer` --- ### 📝 Commits (6) - [`00073af`](https://github.com/netbox-community/netbox/commit/00073af7a6a6894fb1873bfd5b5531a2e4fd2f89) Change get_prefetches_for_serializer to annotate nested serializers - [`5ea85b4`](https://github.com/netbox-community/netbox/commit/5ea85b410e7122e7f5089f65e134daa50a994169) fix typo - [`53e8da6`](https://github.com/netbox-community/netbox/commit/53e8da674fbc9bc41db2d89018860a667d17586d) refactor get_prefetches_for_serializer - [`603253d`](https://github.com/netbox-community/netbox/commit/603253ddd7b8a6b27ae7a636d4fd3781a24500a7) Removed prefetch for model fields, since its a Serializer and add for tags - [`68d9c39`](https://github.com/netbox-community/netbox/commit/68d9c3958d9b0b8f008ad16efd619b1007983f29) Generalize tags use case - [`603c269`](https://github.com/netbox-community/netbox/commit/603c269a87e47cb904ee045ed8509c29780269e6) Add get_annotations_for_subfields and remove recursion ### 📊 Changes **1 file changed** (+20 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `netbox/utilities/api.py` (+20 -5) </details> ### 📄 Description ### Fixes: #17976 DeviceType_Count on Manufacturer * Changed `get_prefetches_for_serializer` to support nested serializers * For each nested field select all `RelatedObjectCountField` fields and create a `Prefetch` with the correct annotation --- <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-30 00:21:37 +01:00
adam closed this issue 2025-12-30 00:21:37 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15382