[PR #3553] [MERGED] Replace all instances of .extra() in QuerySets with annotations #3117 #12579

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/3553
Author: @chambersh1129
Created: 9/29/2019
Status: Merged
Merged: 10/10/2019
Merged by: @kobayashi

Base: developHead: develop


📝 Commits (2)

  • bdb3838 Replace all instances of .extra() in QuerySets with annotations, including references in docstrings
  • 52e9369 PEP 8 E121 continuation line under-indented for hanging indent fix

📊 Changes

3 files changed (+12 additions, -10 deletions)

View changed files

📝 netbox/ipam/querysets.py (+1 -1)
📝 netbox/ipam/views.py (+5 -4)
📝 netbox/utilities/managers.py (+6 -5)

📄 Description

Fixes: #3117

  • replaced two instances of queryset.extra() function with queryset.annotate()

  • replaced single reference of .extra() in docstrings to .annotate() in order to prevent confusion if function is refactored in the future


🔄 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/3553 **Author:** [@chambersh1129](https://github.com/chambersh1129) **Created:** 9/29/2019 **Status:** ✅ Merged **Merged:** 10/10/2019 **Merged by:** [@kobayashi](https://github.com/kobayashi) **Base:** `develop` ← **Head:** `develop` --- ### 📝 Commits (2) - [`bdb3838`](https://github.com/netbox-community/netbox/commit/bdb3838d71606cb28d83b82dc5323641788ea4ad) Replace all instances of .extra() in QuerySets with annotations, including references in docstrings - [`52e9369`](https://github.com/netbox-community/netbox/commit/52e9369af4a485087522acee52ae95005739bae7) PEP 8 E121 continuation line under-indented for hanging indent fix ### 📊 Changes **3 files changed** (+12 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `netbox/ipam/querysets.py` (+1 -1) 📝 `netbox/ipam/views.py` (+5 -4) 📝 `netbox/utilities/managers.py` (+6 -5) </details> ### 📄 Description **Fixes**: #3117 - replaced two instances of queryset.extra() function with queryset.annotate() - replaced single reference of .extra() in docstrings to .annotate() in order to prevent confusion if function is refactored in the future --- <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:22:26 +01:00
adam closed this issue 2025-12-29 22:22:26 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12579