[PR #15623] [MERGED] Closes #14690: Pretty-format JSON fields in the config form #14629

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/15623
Author: @markkuleinio
Created: 4/4/2024
Status: Merged
Merged: 4/22/2024
Merged by: @jeremystretch

Base: developHead: 14690-json-encoder-for-params


📝 Commits (4)

  • 7d4d347 Closes #14690: Pretty-format JSON fields in the config form
  • 1d741b7 Revert changes
  • a7b9498 Use our own JSONField for config parameters for pretty editor outputs
  • adc2c93 Compare identity instead of equality

📊 Changes

1 file changed (+5 additions, -1 deletions)

View changed files

📝 netbox/core/forms/model_forms.py (+5 -1)

📄 Description

Fixes: #14690

Adds encoder attribute in ConfigParam that is set to a custom JSON encoder if field is a JSONField.

Replaces the Django-original JSONField params with our own JSONFields, to get pretty JSON printing in the configuration editor.


🔄 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/15623 **Author:** [@markkuleinio](https://github.com/markkuleinio) **Created:** 4/4/2024 **Status:** ✅ Merged **Merged:** 4/22/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `14690-json-encoder-for-params` --- ### 📝 Commits (4) - [`7d4d347`](https://github.com/netbox-community/netbox/commit/7d4d347ff0b8a233b36778311dc14d311211d850) Closes #14690: Pretty-format JSON fields in the config form - [`1d741b7`](https://github.com/netbox-community/netbox/commit/1d741b79e1e0c3c1ea81eca2e942fadcb2c232eb) Revert changes - [`a7b9498`](https://github.com/netbox-community/netbox/commit/a7b949812475a07c967015ff2645a931ab773371) Use our own JSONField for config parameters for pretty editor outputs - [`adc2c93`](https://github.com/netbox-community/netbox/commit/adc2c93682299e965e5fcdde2e0f76eda4d3daec) Compare identity instead of equality ### 📊 Changes **1 file changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `netbox/core/forms/model_forms.py` (+5 -1) </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: #14690 <!-- Please include a summary of the proposed changes below. --> ~~Adds `encoder` attribute in `ConfigParam` that is set to a custom JSON encoder if field is a `JSONField`.~~ Replaces the Django-original `JSONField` params with our own `JSONField`s, to get pretty JSON printing in the configuration editor. --- <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:25:37 +01:00
adam closed this issue 2025-12-29 23:25:37 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14629