[PR #16710] [MERGED] 9627 use ArrayField on VLANGroup for allowed VLANs #14893

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/16710
Author: @arthanson
Created: 6/24/2024
Status: Merged
Merged: 7/16/2024
Merged by: @jeremystretch

Base: featureHead: 9627-vlan-group3


📝 Commits (10+)

📊 Changes

25 files changed (+429 additions, -104 deletions)

View changed files

📝 docs/models/ipam/vlangroup.md (+2 -2)
📝 netbox/ipam/api/serializers_/vlans.py (+4 -3)
📝 netbox/ipam/filtersets.py (+19 -1)
📝 netbox/ipam/forms/bulk_edit.py (+6 -13)
📝 netbox/ipam/forms/bulk_import.py (+5 -13)
📝 netbox/ipam/forms/filtersets.py (+6 -13)
📝 netbox/ipam/forms/model_forms.py (+7 -3)
📝 netbox/ipam/graphql/types.py (+1 -0)
netbox/ipam/migrations/0070_vlangroup_vlan_id_ranges.py (+55 -0)
📝 netbox/ipam/models/vlans.py (+51 -30)
📝 netbox/ipam/querysets.py (+2 -1)
📝 netbox/ipam/search.py (+1 -2)
📝 netbox/ipam/tables/vlans.py (+5 -1)
📝 netbox/ipam/tests/test_api.py (+2 -2)
📝 netbox/ipam/tests/test_filtersets.py (+57 -8)
📝 netbox/ipam/tests/test_models.py (+12 -2)
📝 netbox/ipam/tests/test_views.py (+1 -2)
📝 netbox/ipam/utils.py (+14 -3)
📝 netbox/ipam/views.py (+2 -2)
📝 netbox/netbox/api/fields.py (+18 -0)

...and 5 more files

📄 Description

Fixes: #9627

Note: The min_vid and max_vid filters were removed, It might be possible to do some PostGres fu to filter inside the arrays for min / max. Could also make internal fields storing the array min and max and filter against that. Tried storing the expanded array as individual items, but that runs into the PostGres row size limit so is not tenable.

Currently using vlan_id_ranges for the name, wondering if allowed_vlans or allowed_vlan_ids would be a better name?


🔄 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/16710 **Author:** [@arthanson](https://github.com/arthanson) **Created:** 6/24/2024 **Status:** ✅ Merged **Merged:** 7/16/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `9627-vlan-group3` --- ### 📝 Commits (10+) - [`26a96fb`](https://github.com/netbox-community/netbox/commit/26a96fb06f50dd045401f59830d8234b0ef1892c) 9627 initial commit - [`9e99703`](https://github.com/netbox-community/netbox/commit/9e99703d37a202d3b342b7c92188516188776ba7) Merge branch 'feature' into 9627-vlan-group - [`2f2945b`](https://github.com/netbox-community/netbox/commit/2f2945b8257a3a021fa42c54126f3753f2aa75c3) 9627 numeric range field - [`8e67c54`](https://github.com/netbox-community/netbox/commit/8e67c548afca39b6ca9f50f2fb685b74df999abe) 9627 numeric range field - [`8f8ba2c`](https://github.com/netbox-community/netbox/commit/8f8ba2c86c94b105b8930febd91cd96fee6812fb) 9627 numeric range field - [`da8cf67`](https://github.com/netbox-community/netbox/commit/da8cf67d5e4551f61aee5976c3da4040a779676e) 9627 numeric range field - [`2f38ecc`](https://github.com/netbox-community/netbox/commit/2f38ecc268bcb65112bdbdffef24cb2bbb6e5e86) 9627 add stuff for utilization calc - [`0411f0d`](https://github.com/netbox-community/netbox/commit/0411f0dc62f2e9149d6e6140006f8aef6ba8fcfc) 9627 update views - [`8fd80d7`](https://github.com/netbox-community/netbox/commit/8fd80d786cf75ea2f50e9fc90f2837e3262c9e37) 9627 fixes - [`9bc2b8e`](https://github.com/netbox-community/netbox/commit/9bc2b8ebf85af0bc08b4b9e9a4f19d37e2671577) 9627 available_vlans ### 📊 Changes **25 files changed** (+429 additions, -104 deletions) <details> <summary>View changed files</summary> 📝 `docs/models/ipam/vlangroup.md` (+2 -2) 📝 `netbox/ipam/api/serializers_/vlans.py` (+4 -3) 📝 `netbox/ipam/filtersets.py` (+19 -1) 📝 `netbox/ipam/forms/bulk_edit.py` (+6 -13) 📝 `netbox/ipam/forms/bulk_import.py` (+5 -13) 📝 `netbox/ipam/forms/filtersets.py` (+6 -13) 📝 `netbox/ipam/forms/model_forms.py` (+7 -3) 📝 `netbox/ipam/graphql/types.py` (+1 -0) ➕ `netbox/ipam/migrations/0070_vlangroup_vlan_id_ranges.py` (+55 -0) 📝 `netbox/ipam/models/vlans.py` (+51 -30) 📝 `netbox/ipam/querysets.py` (+2 -1) 📝 `netbox/ipam/search.py` (+1 -2) 📝 `netbox/ipam/tables/vlans.py` (+5 -1) 📝 `netbox/ipam/tests/test_api.py` (+2 -2) 📝 `netbox/ipam/tests/test_filtersets.py` (+57 -8) 📝 `netbox/ipam/tests/test_models.py` (+12 -2) 📝 `netbox/ipam/tests/test_views.py` (+1 -2) 📝 `netbox/ipam/utils.py` (+14 -3) 📝 `netbox/ipam/views.py` (+2 -2) 📝 `netbox/netbox/api/fields.py` (+18 -0) _...and 5 more files_ </details> ### 📄 Description ### Fixes: #9627 Note: The min_vid and max_vid filters were removed, It might be possible to do some PostGres fu to filter inside the arrays for min / max. Could also make internal fields storing the array min and max and filter against that. Tried storing the expanded array as individual items, but that runs into the PostGres row size limit so is not tenable. Currently using `vlan_id_ranges` for the name, wondering if allowed_vlans or allowed_vlan_ids would be a better name? --- <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:27:19 +01:00
adam closed this issue 2025-12-29 23:27:19 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14893