[PR #19014] [MERGED] Closes #19002: Module type profiles #15505

Closed
opened 2025-12-30 00:22:21 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19014
Author: @jeremystretch
Created: 3/26/2025
Status: Merged
Merged: 4/1/2025
Merged by: @jnovinger

Base: featureHead: 19002-moduletypeprofile


📝 Commits (10+)

  • 65ad972 Move Module & ModuleType models to a separate file
  • 678e6f1 Add ModuleTypeProfile & related fields
  • 69e67d0 Initial work on JSON schema validation
  • 3cda074 Add attributes property on ModuleType
  • 93bd2ee Introduce MultipleOfValidator
  • a67ea13 Introduce JSONSchemaProperty
  • 5f70732 Enable dynamic form field rendering
  • ad9c5ca Misc cleanup
  • c1ff89e Fix migration conflict
  • 0d2a8b8 Ensure deterministic ordering of attriubte fields

📊 Changes

47 files changed (+1732 additions, -321 deletions)

View changed files

📝 base_requirements.txt (+4 -0)
📝 docs/models/dcim/moduletype.md (+8 -0)
docs/models/dcim/moduletypeprofile.md (+40 -0)
📝 netbox/dcim/api/serializers_/devicetypes.py (+28 -6)
📝 netbox/dcim/api/urls.py (+1 -0)
📝 netbox/dcim/api/views.py (+6 -0)
📝 netbox/dcim/filtersets.py (+29 -2)
📝 netbox/dcim/forms/bulk_edit.py (+30 -3)
📝 netbox/dcim/forms/bulk_import.py (+16 -0)
📝 netbox/dcim/forms/filtersets.py (+15 -1)
📝 netbox/dcim/forms/model_forms.py (+87 -5)
📝 netbox/dcim/graphql/filters.py (+6 -0)
📝 netbox/dcim/graphql/schema.py (+3 -0)
📝 netbox/dcim/graphql/types.py (+12 -0)
netbox/dcim/migrations/0205_moduletypeprofile.py (+57 -0)
netbox/dcim/migrations/0206_load_module_type_profiles.py (+42 -0)
netbox/dcim/migrations/initial_data/module_type_profiles/cpu.json (+20 -0)
netbox/dcim/migrations/initial_data/module_type_profiles/fan.json (+12 -0)
netbox/dcim/migrations/initial_data/module_type_profiles/gpu.json (+28 -0)
netbox/dcim/migrations/initial_data/module_type_profiles/hard_disk.json (+29 -0)

...and 27 more files

📄 Description

Closes: #19002

  • Move Module & ModuleType models to modules.py
  • Introduce the new ModuleTypeProfile model
  • Add profile ForeignKey and attribute_data JSONField on ModuleType
  • Implement JSONSchemaProperty for rendering form fields from JSON schema properties
  • Introduce MultipleOfValidator
  • Extend the model form for ModuleType to render attribute fields depending on the selected profile
  • Enable filtering of module types by attribute values
  • Include some initial profiles to be installed during migration
  • Documentation & tests

🔄 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/19014 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 3/26/2025 **Status:** ✅ Merged **Merged:** 4/1/2025 **Merged by:** [@jnovinger](https://github.com/jnovinger) **Base:** `feature` ← **Head:** `19002-moduletypeprofile` --- ### 📝 Commits (10+) - [`65ad972`](https://github.com/netbox-community/netbox/commit/65ad972a1c18facb77b224dd4b22e7c8815ae5b4) Move Module & ModuleType models to a separate file - [`678e6f1`](https://github.com/netbox-community/netbox/commit/678e6f1bd5400b780729bf920a85076b31ac0e68) Add ModuleTypeProfile & related fields - [`69e67d0`](https://github.com/netbox-community/netbox/commit/69e67d025831a98303dea8e1913f17ce0f346779) Initial work on JSON schema validation - [`3cda074`](https://github.com/netbox-community/netbox/commit/3cda074cbd1f86bb480ff8cdfbab82e8940b45fe) Add attributes property on ModuleType - [`93bd2ee`](https://github.com/netbox-community/netbox/commit/93bd2ee5b8cbfbffe05484472db310024aec37e6) Introduce MultipleOfValidator - [`a67ea13`](https://github.com/netbox-community/netbox/commit/a67ea1305edb49d8ae4e4d015154764b7bda3e5f) Introduce JSONSchemaProperty - [`5f70732`](https://github.com/netbox-community/netbox/commit/5f707320ea16416d8d88bbc1193c5d8684058ec3) Enable dynamic form field rendering - [`ad9c5ca`](https://github.com/netbox-community/netbox/commit/ad9c5ca4199b46252387d606d3ae3c4f24cef65a) Misc cleanup - [`c1ff89e`](https://github.com/netbox-community/netbox/commit/c1ff89e98f62a02729a5fccea1fe4ee2fdd14e4e) Fix migration conflict - [`0d2a8b8`](https://github.com/netbox-community/netbox/commit/0d2a8b8b859599e8f83f5a6a7c2f40973cb7ff81) Ensure deterministic ordering of attriubte fields ### 📊 Changes **47 files changed** (+1732 additions, -321 deletions) <details> <summary>View changed files</summary> 📝 `base_requirements.txt` (+4 -0) 📝 `docs/models/dcim/moduletype.md` (+8 -0) ➕ `docs/models/dcim/moduletypeprofile.md` (+40 -0) 📝 `netbox/dcim/api/serializers_/devicetypes.py` (+28 -6) 📝 `netbox/dcim/api/urls.py` (+1 -0) 📝 `netbox/dcim/api/views.py` (+6 -0) 📝 `netbox/dcim/filtersets.py` (+29 -2) 📝 `netbox/dcim/forms/bulk_edit.py` (+30 -3) 📝 `netbox/dcim/forms/bulk_import.py` (+16 -0) 📝 `netbox/dcim/forms/filtersets.py` (+15 -1) 📝 `netbox/dcim/forms/model_forms.py` (+87 -5) 📝 `netbox/dcim/graphql/filters.py` (+6 -0) 📝 `netbox/dcim/graphql/schema.py` (+3 -0) 📝 `netbox/dcim/graphql/types.py` (+12 -0) ➕ `netbox/dcim/migrations/0205_moduletypeprofile.py` (+57 -0) ➕ `netbox/dcim/migrations/0206_load_module_type_profiles.py` (+42 -0) ➕ `netbox/dcim/migrations/initial_data/module_type_profiles/cpu.json` (+20 -0) ➕ `netbox/dcim/migrations/initial_data/module_type_profiles/fan.json` (+12 -0) ➕ `netbox/dcim/migrations/initial_data/module_type_profiles/gpu.json` (+28 -0) ➕ `netbox/dcim/migrations/initial_data/module_type_profiles/hard_disk.json` (+29 -0) _...and 27 more files_ </details> ### 📄 Description ### Closes: #19002 - Move Module & ModuleType models to `modules.py` - Introduce the new ModuleTypeProfile model - Add `profile` ForeignKey and `attribute_data` JSONField on ModuleType - Implement JSONSchemaProperty for rendering form fields from JSON schema properties - Introduce MultipleOfValidator - Extend the model form for ModuleType to render attribute fields depending on the selected profile - Enable filtering of module types by attribute values - Include some initial profiles to be installed during migration - Documentation & tests --- <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-30 00:22:21 +01:00
adam closed this issue 2025-12-30 00:22:21 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15505