[PR #14152] [MERGED] Closes #13427: Public model registration #14325

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/14152
Author: @jeremystretch
Created: 10/31/2023
Status: Merged
Merged: 11/3/2023
Merged by: @jeremystretch

Base: featureHead: 13427-public-models


📝 Commits (3)

📊 Changes

18 files changed (+98 additions, -22 deletions)

View changed files

📝 docs/development/application-registry.md (+4 -0)
📝 netbox/account/models.py (+2 -0)
netbox/core/migrations/0008_contenttype_proxy.py (+29 -0)
📝 netbox/core/models/__init__.py (+1 -0)
netbox/core/models/contenttypes.py (+32 -0)
📝 netbox/core/models/data.py (+2 -0)
📝 netbox/core/models/files.py (+1 -0)
📝 netbox/dcim/models/cables.py (+2 -0)
📝 netbox/extras/dashboard/widgets.py (+2 -7)
📝 netbox/extras/forms/bulk_import.py (+2 -3)
📝 netbox/extras/forms/filtersets.py (+2 -3)
📝 netbox/extras/forms/model_forms.py (+2 -5)
📝 netbox/extras/models/configs.py (+6 -4)
📝 netbox/extras/models/search.py (+2 -0)
📝 netbox/extras/models/tags.py (+2 -0)
📝 netbox/extras/utils.py (+4 -0)
📝 netbox/netbox/registry.py (+1 -0)
📝 netbox/users/models.py (+2 -0)

📄 Description

Closes: #13427

  • Record any models not having _netbox_private = True in registry['models']
  • Introduce a proxy model for ContentType with a custom ContentTypeManager
  • ContentTypeManager provides a public() method which returns all ContentTypes matching public models
  • Update imports of ContentType to use the proxy model where public() is needed

🔄 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/14152 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 10/31/2023 **Status:** ✅ Merged **Merged:** 11/3/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `13427-public-models` --- ### 📝 Commits (3) - [`af24894`](https://github.com/netbox-community/netbox/commit/af248941c287f3b4e85c9e385bee1392a58de495) Initial work on #13427 - [`859557d`](https://github.com/netbox-community/netbox/commit/859557d542c1ef2e19543ce22def7c5001eae1e5) Clarify documentation - [`4902043`](https://github.com/netbox-community/netbox/commit/4902043da88f76fdc14b765998ca2524064f0f6c) Reference public models registry when populating models for ConfigTemplate context ### 📊 Changes **18 files changed** (+98 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `docs/development/application-registry.md` (+4 -0) 📝 `netbox/account/models.py` (+2 -0) ➕ `netbox/core/migrations/0008_contenttype_proxy.py` (+29 -0) 📝 `netbox/core/models/__init__.py` (+1 -0) ➕ `netbox/core/models/contenttypes.py` (+32 -0) 📝 `netbox/core/models/data.py` (+2 -0) 📝 `netbox/core/models/files.py` (+1 -0) 📝 `netbox/dcim/models/cables.py` (+2 -0) 📝 `netbox/extras/dashboard/widgets.py` (+2 -7) 📝 `netbox/extras/forms/bulk_import.py` (+2 -3) 📝 `netbox/extras/forms/filtersets.py` (+2 -3) 📝 `netbox/extras/forms/model_forms.py` (+2 -5) 📝 `netbox/extras/models/configs.py` (+6 -4) 📝 `netbox/extras/models/search.py` (+2 -0) 📝 `netbox/extras/models/tags.py` (+2 -0) 📝 `netbox/extras/utils.py` (+4 -0) 📝 `netbox/netbox/registry.py` (+1 -0) 📝 `netbox/users/models.py` (+2 -0) </details> ### 📄 Description ### Closes: #13427 - Record any models not having `_netbox_private = True` in `registry['models']` - Introduce a proxy model for ContentType with a custom ContentTypeManager - ContentTypeManager provides a `public()` method which returns all ContentTypes matching public models - Update imports of ContentType to use the proxy model where `public()` is needed --- <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:50 +01:00
adam closed this issue 2025-12-29 23:23:50 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14325