[PR #13389] [MERGED] Exposes all models in device context data #14177

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/13389
Author: @abhi1693
Created: 8/4/2023
Status: Merged
Merged: 8/9/2023
Merged by: @jeremystretch

Base: featureHead: feat/12814-expose-models


📝 Commits (6)

  • 7a953fa exposes all models in device context data #12814
  • b50ce17 added app namespaces to the context data
  • 55c7c14 revert object to device in context data
  • 69ffdbf moved context to render method of ConfigTemplate
  • 93f6574 removed print
  • 2d3d885 Include only registered models; permit passed context data to overwrite apps

📊 Changes

1 file changed (+16 additions, -2 deletions)

View changed files

📝 netbox/extras/models/configs.py (+16 -2)

📄 Description

Fixes: #12814

To avoid confusion between device and Device, I have renamed device to object. The models are exposed using the class model name and are limited to models that have custom_field features.


🔄 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/13389 **Author:** [@abhi1693](https://github.com/abhi1693) **Created:** 8/4/2023 **Status:** ✅ Merged **Merged:** 8/9/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `feat/12814-expose-models` --- ### 📝 Commits (6) - [`7a953fa`](https://github.com/netbox-community/netbox/commit/7a953fa5ef3d4f65e2733becdcbd985e45c29953) exposes all models in device context data #12814 - [`b50ce17`](https://github.com/netbox-community/netbox/commit/b50ce17f571dd6fb26d1775af1e4b6238b13f893) added app namespaces to the context data - [`55c7c14`](https://github.com/netbox-community/netbox/commit/55c7c14fba2401c16d522073a39d2ddb9547b4e3) revert object to device in context data - [`69ffdbf`](https://github.com/netbox-community/netbox/commit/69ffdbf8dda249d17d8e1d0d11391b67bb678dc9) moved context to render method of ConfigTemplate - [`93f6574`](https://github.com/netbox-community/netbox/commit/93f657490245638c2fc3e2d14f0a797a5f6c6cce) removed print - [`2d3d885`](https://github.com/netbox-community/netbox/commit/2d3d8850c2df46f1fa4d532879d64f93a406f452) Include only registered models; permit passed context data to overwrite apps ### 📊 Changes **1 file changed** (+16 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/models/configs.py` (+16 -2) </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes: #12814 <!-- Please include a summary of the proposed changes below. --> To avoid confusion between `device` and `Device`, I have renamed `device` to `object`. The models are exposed using the class model name and are limited to models that have `custom_field` features. --- <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:01 +01:00
adam closed this issue 2025-12-29 23:23:01 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14177