[PR #19844] Closes: #7845 - Direct relationship between IP objects and Prefixes #15732

Open
opened 2025-12-30 00:23:42 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19844
Author: @DanSheps
Created: 7/9/2025
Status: 🔄 Open

Base: featureHead: feature-ip-prefix-link


📝 Commits (10+)

📊 Changes

31 files changed (+1218 additions, -95 deletions)

View changed files

📝 base_requirements.txt (+5 -0)
📝 netbox/ipam/api/serializers_/ip.py (+19 -10)
📝 netbox/ipam/filtersets.py (+40 -0)
📝 netbox/ipam/forms/bulk_edit.py (+23 -3)
📝 netbox/ipam/forms/bulk_import.py (+62 -2)
📝 netbox/ipam/forms/filtersets.py (+22 -3)
📝 netbox/ipam/forms/model_forms.py (+31 -8)
📝 netbox/ipam/graphql/filters.py (+6 -0)
📝 netbox/ipam/graphql/types.py (+4 -0)
netbox/ipam/migrations/0083_ipaddress_iprange_prefix_parent.py (+58 -0)
netbox/ipam/migrations/0083_ipaddress_iprange_prefix_parent_data.py (+134 -0)
netbox/ipam/migrations/0084_prefix_ipam_prefix_delete_prefix_ipam_prefix_insert.py (+43 -0)
netbox/ipam/migrations/0085_alter_prefix_parent.py (+25 -0)
netbox/ipam/migrations/0086_update_trigger.py (+65 -0)
📝 netbox/ipam/models/ip.py (+163 -23)
📝 netbox/ipam/search.py (+7 -3)
📝 netbox/ipam/tables/ip.py (+25 -9)
📝 netbox/ipam/tables/template_code.py (+14 -6)
📝 netbox/ipam/tests/test_api.py (+6 -3)
📝 netbox/ipam/tests/test_filtersets.py (+6 -0)

...and 11 more files

📄 Description

Fixes: #7845 - Direct relationship between IP objects and Prefixes

  • Add FK from IPAddress to Prefix
  • Add FK from IPRange to Prefix
  • Add FK from Prefix to (Parent) Prefix
  • Add FK from Prefix to Aggregate
  • Adjusted Search Indicies
  • Adjusted Filtersets
    • Added filter for Prefix to IPAddress and IPRange Filterset
    • Added filter for parent and Aggregate to Prefix Filterset

🔄 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/19844 **Author:** [@DanSheps](https://github.com/DanSheps) **Created:** 7/9/2025 **Status:** 🔄 Open **Base:** `feature` ← **Head:** `feature-ip-prefix-link` --- ### 📝 Commits (10+) - [`747fef0`](https://github.com/netbox-community/netbox/commit/747fef0bc2c2c13b4db9ea7aa9a1c261fc7ee3af) Work on IP to Prefix ForeignKey relationship - [`738ef63`](https://github.com/netbox-community/netbox/commit/738ef63527d32cd3aca068e1db4204dd012c3213) Update from feature - [`68d0b58`](https://github.com/netbox-community/netbox/commit/68d0b58293c7e32932bcc4c5bc058d7000c3b0bb) Update migration - [`4c8301b`](https://github.com/netbox-community/netbox/commit/4c8301b3a5589398892aead03105e17f0f4a8437) Update migration - [`c211b62`](https://github.com/netbox-community/netbox/commit/c211b624d0b1967a56be2b08d47597a316b078b2) Merge branch 'feature' of https://github.com/netbox-community/netbox into feature-ip-prefix-link - [`c5e7b21`](https://github.com/netbox-community/netbox/commit/c5e7b21147651483ec89e5ff6da4b401a5f9b0fc) Add additional FKs - [`b19f81c`](https://github.com/netbox-community/netbox/commit/b19f81cedebaa61197c1c5be62d6d7ae794a24e6) More work on IP Address/Range and Prefix relationship - [`697d5bd`](https://github.com/netbox-community/netbox/commit/697d5bd876cf2ad3526e68ab25602f9af375c68c) Slightly DRY the migration - [`ade4354`](https://github.com/netbox-community/netbox/commit/ade4354ca4ac43497353d0e7ee7ee96eeb00e666) Fix some test errors - [`7eb3a8d`](https://github.com/netbox-community/netbox/commit/7eb3a8d37933b051c61dd071fee2bad1466ed213) Fix some tests ### 📊 Changes **31 files changed** (+1218 additions, -95 deletions) <details> <summary>View changed files</summary> 📝 `base_requirements.txt` (+5 -0) 📝 `netbox/ipam/api/serializers_/ip.py` (+19 -10) 📝 `netbox/ipam/filtersets.py` (+40 -0) 📝 `netbox/ipam/forms/bulk_edit.py` (+23 -3) 📝 `netbox/ipam/forms/bulk_import.py` (+62 -2) 📝 `netbox/ipam/forms/filtersets.py` (+22 -3) 📝 `netbox/ipam/forms/model_forms.py` (+31 -8) 📝 `netbox/ipam/graphql/filters.py` (+6 -0) 📝 `netbox/ipam/graphql/types.py` (+4 -0) ➕ `netbox/ipam/migrations/0083_ipaddress_iprange_prefix_parent.py` (+58 -0) ➕ `netbox/ipam/migrations/0083_ipaddress_iprange_prefix_parent_data.py` (+134 -0) ➕ `netbox/ipam/migrations/0084_prefix_ipam_prefix_delete_prefix_ipam_prefix_insert.py` (+43 -0) ➕ `netbox/ipam/migrations/0085_alter_prefix_parent.py` (+25 -0) ➕ `netbox/ipam/migrations/0086_update_trigger.py` (+65 -0) 📝 `netbox/ipam/models/ip.py` (+163 -23) 📝 `netbox/ipam/search.py` (+7 -3) 📝 `netbox/ipam/tables/ip.py` (+25 -9) 📝 `netbox/ipam/tables/template_code.py` (+14 -6) 📝 `netbox/ipam/tests/test_api.py` (+6 -3) 📝 `netbox/ipam/tests/test_filtersets.py` (+6 -0) _...and 11 more files_ </details> ### 📄 Description ### Fixes: #7845 - Direct relationship between IP objects and Prefixes * Add FK from IPAddress to Prefix * Add FK from IPRange to Prefix * Add FK from Prefix to (Parent) Prefix * Add FK from Prefix to Aggregate * Adjusted Search Indicies * Adjusted Filtersets * Added filter for Prefix to IPAddress and IPRange Filterset * Added filter for `parent` and Aggregate to Prefix Filterset --- <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:23:42 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15732