[PR #14191] [MERGED] Closes #14153: Filter ContentTypes by supported feature #14329

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/14191
Author: @jeremystretch
Created: 11/6/2023
Status: Merged
Merged: 11/16/2023
Merged by: @jeremystretch

Base: featureHead: 14153-replace-featurequery


📝 Commits (6)

  • 7d5c36c WIP
  • b692b14 Remove FeatureQuery
  • 69c4f2a Standardize use of proxy ContentType for models
  • d575737 Remove TODO
  • bfd10eb Correctly filter BookmarksWidget object_types choices
  • aef8ff0 Add feature-specific object type validation

📊 Changes

30 files changed (+152 additions, -142 deletions)

View changed files

📝 netbox/core/forms/filtersets.py (+1 -3)
📝 netbox/core/migrations/0003_job.py (+1 -2)
📝 netbox/core/models/contenttypes.py (+18 -0)
📝 netbox/core/models/data.py (+1 -2)
📝 netbox/core/models/jobs.py (+12 -4)
📝 netbox/dcim/models/cables.py (+2 -3)
📝 netbox/dcim/models/device_component_templates.py (+1 -2)
📝 netbox/dcim/models/device_components.py (+1 -2)
📝 netbox/extras/api/serializers.py (+7 -8)
📝 netbox/extras/dashboard/widgets.py (+11 -5)
📝 netbox/extras/forms/bulk_import.py (+4 -9)
📝 netbox/extras/forms/filtersets.py (+7 -8)
📝 netbox/extras/forms/model_forms.py (+6 -13)
📝 netbox/extras/migrations/0001_squashed.py (+5 -5)
📝 netbox/extras/migrations/0094_tag_object_types.py (+1 -2)
📝 netbox/extras/models/change_logging.py (+15 -3)
📝 netbox/extras/models/customfields.py (+3 -6)
📝 netbox/extras/models/models.py (+29 -13)
📝 netbox/extras/models/search.py (+1 -2)
📝 netbox/extras/models/staging.py (+1 -2)

...and 10 more files

📄 Description

Fixes: #14153

  • Add a with_feature() method to the manager for our ContentType proxy model
  • Replace all uses of FeatureQuery with the new method
  • Remove FeatureQuery
  • Update all ForeignKey references to ContentType to use a string name (rather than the class itself) to simplify imports and avoid migration errors with GenericForeignKeys

🔄 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/14191 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 11/6/2023 **Status:** ✅ Merged **Merged:** 11/16/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `14153-replace-featurequery` --- ### 📝 Commits (6) - [`7d5c36c`](https://github.com/netbox-community/netbox/commit/7d5c36c573b06e4df79dbb880b1cc6d8696fdadc) WIP - [`b692b14`](https://github.com/netbox-community/netbox/commit/b692b146cb9b4f7aacbd3ffc015168dc499cdd56) Remove FeatureQuery - [`69c4f2a`](https://github.com/netbox-community/netbox/commit/69c4f2a80a41e68b546a93af43bb2c6f6c77ec74) Standardize use of proxy ContentType for models - [`d575737`](https://github.com/netbox-community/netbox/commit/d575737f9295de6860c8c480301141ef97012d1b) Remove TODO - [`bfd10eb`](https://github.com/netbox-community/netbox/commit/bfd10ebfe981f1aa7598fa33c0c672373df652c0) Correctly filter BookmarksWidget object_types choices - [`aef8ff0`](https://github.com/netbox-community/netbox/commit/aef8ff09e7159f746003b78e27033eacbda0d38d) Add feature-specific object type validation ### 📊 Changes **30 files changed** (+152 additions, -142 deletions) <details> <summary>View changed files</summary> 📝 `netbox/core/forms/filtersets.py` (+1 -3) 📝 `netbox/core/migrations/0003_job.py` (+1 -2) 📝 `netbox/core/models/contenttypes.py` (+18 -0) 📝 `netbox/core/models/data.py` (+1 -2) 📝 `netbox/core/models/jobs.py` (+12 -4) 📝 `netbox/dcim/models/cables.py` (+2 -3) 📝 `netbox/dcim/models/device_component_templates.py` (+1 -2) 📝 `netbox/dcim/models/device_components.py` (+1 -2) 📝 `netbox/extras/api/serializers.py` (+7 -8) 📝 `netbox/extras/dashboard/widgets.py` (+11 -5) 📝 `netbox/extras/forms/bulk_import.py` (+4 -9) 📝 `netbox/extras/forms/filtersets.py` (+7 -8) 📝 `netbox/extras/forms/model_forms.py` (+6 -13) 📝 `netbox/extras/migrations/0001_squashed.py` (+5 -5) 📝 `netbox/extras/migrations/0094_tag_object_types.py` (+1 -2) 📝 `netbox/extras/models/change_logging.py` (+15 -3) 📝 `netbox/extras/models/customfields.py` (+3 -6) 📝 `netbox/extras/models/models.py` (+29 -13) 📝 `netbox/extras/models/search.py` (+1 -2) 📝 `netbox/extras/models/staging.py` (+1 -2) _...and 10 more files_ </details> ### 📄 Description ### Fixes: #14153 - Add a `with_feature()` method to the manager for our ContentType proxy model - Replace all uses of FeatureQuery with the new method - Remove FeatureQuery - Update all ForeignKey references to ContentType to use a string name (rather than the class itself) to simplify imports and avoid migration errors with GenericForeignKeys --- <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:23:51 +01:00
adam closed this issue 2025-12-29 23:23:51 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14329