[PR #6576] [MERGED] Closes #5963: Custom model validation #13142

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/6576
Author: @jeremystretch
Created: 6/9/2021
Status: Merged
Merged: 6/9/2021
Merged by: @jeremystretch

Base: featureHead: 5963-custom-validation


📝 Commits (5)

  • 3bfa1cb Initial work on custom model validation
  • dfd42c9 Document the new post_clean signal
  • c69ef95 Document the custom validation feature
  • f81b3d4 Rename fail() kwarg from attr to field
  • 44c0dec Extend CustomValidator to support required, prohibited fields

📊 Changes

11 files changed (+387 additions, -5 deletions)

View changed files

docs/additional-features/custom-validation.md (+86 -0)
📝 docs/configuration/optional-settings.md (+7 -1)
docs/development/signals.md (+11 -0)
📝 mkdocs.yml (+2 -0)
📝 netbox/extras/signals.py (+14 -0)
netbox/extras/tests/test_customvalidator.py (+121 -0)
netbox/extras/validators.py (+107 -0)
📝 netbox/netbox/configuration.example.py (+14 -0)
📝 netbox/netbox/models.py (+19 -4)
📝 netbox/netbox/settings.py (+1 -0)
netbox/netbox/signals.py (+5 -0)

📄 Description

Closes: #5963

  • Introduces the post_clean signal and run_custom_validators() receiver
  • Introduces the CustomValidator class to define validation rules
  • Adds and documents the CUSTOM_VALIDATORS configuration parameter
  • Documents the new custom validation feature

🔄 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/6576 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 6/9/2021 **Status:** ✅ Merged **Merged:** 6/9/2021 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `5963-custom-validation` --- ### 📝 Commits (5) - [`3bfa1cb`](https://github.com/netbox-community/netbox/commit/3bfa1cbf41cf7b2b653a11eb19dff5da23e524ee) Initial work on custom model validation - [`dfd42c9`](https://github.com/netbox-community/netbox/commit/dfd42c9896696f784f061842c382be7be4425309) Document the new post_clean signal - [`c69ef95`](https://github.com/netbox-community/netbox/commit/c69ef95c6a30ce869a4251ba27e9aa3ba12374d2) Document the custom validation feature - [`f81b3d4`](https://github.com/netbox-community/netbox/commit/f81b3d4ed6144783f4fd93929bb08ce8cac41138) Rename fail() kwarg from attr to field - [`44c0dec`](https://github.com/netbox-community/netbox/commit/44c0dec68b4153549c2c750ffee8f4766748983a) Extend CustomValidator to support required, prohibited fields ### 📊 Changes **11 files changed** (+387 additions, -5 deletions) <details> <summary>View changed files</summary> ➕ `docs/additional-features/custom-validation.md` (+86 -0) 📝 `docs/configuration/optional-settings.md` (+7 -1) ➕ `docs/development/signals.md` (+11 -0) 📝 `mkdocs.yml` (+2 -0) 📝 `netbox/extras/signals.py` (+14 -0) ➕ `netbox/extras/tests/test_customvalidator.py` (+121 -0) ➕ `netbox/extras/validators.py` (+107 -0) 📝 `netbox/netbox/configuration.example.py` (+14 -0) 📝 `netbox/netbox/models.py` (+19 -4) 📝 `netbox/netbox/settings.py` (+1 -0) ➕ `netbox/netbox/signals.py` (+5 -0) </details> ### 📄 Description ### Closes: #5963 - Introduces the `post_clean` signal and `run_custom_validators()` receiver - Introduces the `CustomValidator` class to define validation rules - Adds and documents the `CUSTOM_VALIDATORS` configuration parameter - Documents the new custom validation feature --- <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:25:38 +01:00
adam closed this issue 2025-12-29 22:25:38 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13142