[PR #4007] [MERGED] Closes #3880: Define constants for arbitrary values #12725

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/4007
Author: @jeremystretch
Created: 1/24/2020
Status: Merged
Merged: 1/24/2020
Merged by: @jeremystretch

Base: developHead: 3880-use-constants


📝 Commits (2)

  • 096814d #3880: Define constants for arbitrary values
  • c6473d6 Add explanatory text for constants

📊 Changes

11 files changed (+123 additions, -48 deletions)

View changed files

📝 netbox/dcim/constants.py (+26 -2)
📝 netbox/dcim/forms.py (+12 -13)
📝 netbox/dcim/models/__init__.py (+10 -5)
📝 netbox/ipam/constants.py (+43 -1)
📝 netbox/ipam/forms.py (+7 -6)
📝 netbox/ipam/models.py (+3 -3)
📝 netbox/ipam/views.py (+7 -9)
netbox/secrets/constants.py (+5 -0)
📝 netbox/secrets/forms.py (+3 -2)
📝 netbox/utilities/api.py (+0 -1)
📝 netbox/virtualization/forms.py (+7 -6)

📄 Description

Fixes: #3880

Replace statically-defined arbitrary values with named constants for better maintainability. This might not catch everything, but IMO it's sufficient to close #3880 if we're vigilant about the use of constants from here forward.


🔄 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/4007 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 1/24/2020 **Status:** ✅ Merged **Merged:** 1/24/2020 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `3880-use-constants` --- ### 📝 Commits (2) - [`096814d`](https://github.com/netbox-community/netbox/commit/096814dc33524e0f2300c74ecb419b142da8ce2d) #3880: Define constants for arbitrary values - [`c6473d6`](https://github.com/netbox-community/netbox/commit/c6473d654d9995a45ebc4bf612a610d123a24a54) Add explanatory text for constants ### 📊 Changes **11 files changed** (+123 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/constants.py` (+26 -2) 📝 `netbox/dcim/forms.py` (+12 -13) 📝 `netbox/dcim/models/__init__.py` (+10 -5) 📝 `netbox/ipam/constants.py` (+43 -1) 📝 `netbox/ipam/forms.py` (+7 -6) 📝 `netbox/ipam/models.py` (+3 -3) 📝 `netbox/ipam/views.py` (+7 -9) ➕ `netbox/secrets/constants.py` (+5 -0) 📝 `netbox/secrets/forms.py` (+3 -2) 📝 `netbox/utilities/api.py` (+0 -1) 📝 `netbox/virtualization/forms.py` (+7 -6) </details> ### 📄 Description ### Fixes: #3880 Replace statically-defined arbitrary values with named constants for better maintainability. This might not catch everything, but IMO it's sufficient to close #3880 if we're vigilant about the use of constants from here forward. --- <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 22:23:16 +01:00
adam closed this issue 2025-12-29 22:23:16 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12725