[PR #12982] [MERGED] Closes #11541: Support for limiting tag assignments by object type #14081

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

📋 Pull Request Information

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

Base: featureHead: 11541-tag-object-types


📝 Commits (5)

📊 Changes

14 files changed (+156 additions, -27 deletions)

View changed files

📝 docs/models/extras/tag.md (+8 -0)
📝 netbox/extras/api/serializers.py (+7 -1)
📝 netbox/extras/filtersets.py (+9 -1)
📝 netbox/extras/forms/filtersets.py (+5 -0)
📝 netbox/extras/forms/model_forms.py (+7 -2)
netbox/extras/migrations/0093_tagged_item_indexes.py (+0 -17)
netbox/extras/migrations/0094_tag_object_types.py (+23 -0)
📝 netbox/extras/models/tags.py (+12 -1)
📝 netbox/extras/signals.py (+20 -1)
📝 netbox/extras/tables/tables.py (+5 -1)
📝 netbox/extras/tests/test_filtersets.py (+18 -0)
📝 netbox/extras/tests/test_models.py (+18 -0)
📝 netbox/netbox/forms/base.py (+7 -0)
📝 netbox/templates/extras/tag.html (+17 -3)

📄 Description

Closes: #11541

  • Add the object_types many-to-many field on Tag
  • Create a signal receiver (validate_assigned_tags()) to validate tag assignments when a model is saved
  • Limit the tags displayed as available options depending on the model to which they are being added

🔄 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/12982 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 6/23/2023 **Status:** ✅ Merged **Merged:** 6/23/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `11541-tag-object-types` --- ### 📝 Commits (5) - [`9b18923`](https://github.com/netbox-community/netbox/commit/9b189231c3d05b369b87f7f5b4339c14fc60a545) Initial work on #11541 - [`0dc71d8`](https://github.com/netbox-community/netbox/commit/0dc71d8850e95e4180c7ebd13470df66c1fcd531) Merge migrations - [`bbcec4f`](https://github.com/netbox-community/netbox/commit/bbcec4ffff3039b85c4e501142dddcd0732a75d7) Limit tags by object type during assignment - [`8b0633e`](https://github.com/netbox-community/netbox/commit/8b0633ebf249963ce84a55f337ae904cf07ec1d5) Add tests for object type validation - [`f95ceb7`](https://github.com/netbox-community/netbox/commit/f95ceb7c1481c7908e7e4339650ec294f70dd49c) Fix form field parameters ### 📊 Changes **14 files changed** (+156 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `docs/models/extras/tag.md` (+8 -0) 📝 `netbox/extras/api/serializers.py` (+7 -1) 📝 `netbox/extras/filtersets.py` (+9 -1) 📝 `netbox/extras/forms/filtersets.py` (+5 -0) 📝 `netbox/extras/forms/model_forms.py` (+7 -2) ➖ `netbox/extras/migrations/0093_tagged_item_indexes.py` (+0 -17) ➕ `netbox/extras/migrations/0094_tag_object_types.py` (+23 -0) 📝 `netbox/extras/models/tags.py` (+12 -1) 📝 `netbox/extras/signals.py` (+20 -1) 📝 `netbox/extras/tables/tables.py` (+5 -1) 📝 `netbox/extras/tests/test_filtersets.py` (+18 -0) 📝 `netbox/extras/tests/test_models.py` (+18 -0) 📝 `netbox/netbox/forms/base.py` (+7 -0) 📝 `netbox/templates/extras/tag.html` (+17 -3) </details> ### 📄 Description ### Closes: #11541 - Add the `object_types` many-to-many field on Tag - Create a signal receiver (`validate_assigned_tags()`) to validate tag assignments when a model is saved - Limit the tags displayed as available options depending on the model to which they are being added --- <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:23 +01:00
adam closed this issue 2025-12-29 23:22:24 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14081