[PR #4178] [MERGED] Closes #4081: Drop the family column from IP objects #12783

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/4178
Author: @jeremystretch
Created: 2/14/2020
Status: Merged
Merged: 2/14/2020
Merged by: @jeremystretch

Base: develop-2.8Head: 4081-drop-ip-family


📝 Commits (6)

  • 1a8eea5 Fixes #4175: Fix potential exception when bulk editing objects from a filtered list
  • b475a57 Drop family column from Aggregate, Prefix, and IPAddress models
  • 047f13a Update tests
  • 8687226 Update family filters in querysets
  • fcdb052 Restore filters
  • f0ced98 Delete unused test data

📊 Changes

20 files changed (+268 additions, -218 deletions)

View changed files

📝 docs/release-notes/version-2.7.md (+1 -0)
📝 netbox/dcim/forms.py (+2 -2)
📝 netbox/dcim/tests/test_filters.py (+2 -2)
📝 netbox/ipam/fields.py (+2 -0)
📝 netbox/ipam/filters.py (+15 -3)
📝 netbox/ipam/lookups.py (+9 -0)
📝 netbox/ipam/managers.py (+1 -1)
netbox/ipam/migrations/0035_drop_ip_family.py (+38 -0)
📝 netbox/ipam/models.py (+26 -32)
📝 netbox/ipam/tests/test_filters.py (+26 -26)
📝 netbox/ipam/tests/test_models.py (+47 -48)
📝 netbox/ipam/tests/test_ordering.py (+81 -81)
📝 netbox/ipam/tests/test_views.py (+9 -10)
📝 netbox/ipam/views.py (+1 -1)
📝 netbox/templates/ipam/aggregate.html (+1 -1)
📝 netbox/templates/ipam/ipaddress.html (+1 -1)
📝 netbox/templates/ipam/prefix.html (+1 -1)
📝 netbox/templates/utilities/obj_list.html (+2 -2)
📝 netbox/utilities/views.py (+1 -5)
📝 netbox/virtualization/forms.py (+2 -2)

📄 Description

Fixes: #4081

Remove the family field from the Aggregate, Prefix, and IPAddress models. This does not have any effect on the REST API or filter parameters. However, it does remove family as a field lookup in the Django ORM. Use the __family lookup filter now instead:

>>> Prefix.objects.filter(prefix__family=6)

🔄 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/4178 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 2/14/2020 **Status:** ✅ Merged **Merged:** 2/14/2020 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop-2.8` ← **Head:** `4081-drop-ip-family` --- ### 📝 Commits (6) - [`1a8eea5`](https://github.com/netbox-community/netbox/commit/1a8eea5aa943f4f63b76ecadcf9ee7c4ab60e6e2) Fixes #4175: Fix potential exception when bulk editing objects from a filtered list - [`b475a57`](https://github.com/netbox-community/netbox/commit/b475a575e43003143ae80f858995934a89319860) Drop family column from Aggregate, Prefix, and IPAddress models - [`047f13a`](https://github.com/netbox-community/netbox/commit/047f13ac5d47038568f49ea55d0861222a93e4b0) Update tests - [`8687226`](https://github.com/netbox-community/netbox/commit/8687226cc74b2dfb2c1e06ef929f57e0a58b953d) Update family filters in querysets - [`fcdb052`](https://github.com/netbox-community/netbox/commit/fcdb05238c5ce46e9dac4fd12e640b4decc9d9ad) Restore filters - [`f0ced98`](https://github.com/netbox-community/netbox/commit/f0ced98dc6cbe25df11191fcceb6676ceb2e19c0) Delete unused test data ### 📊 Changes **20 files changed** (+268 additions, -218 deletions) <details> <summary>View changed files</summary> 📝 `docs/release-notes/version-2.7.md` (+1 -0) 📝 `netbox/dcim/forms.py` (+2 -2) 📝 `netbox/dcim/tests/test_filters.py` (+2 -2) 📝 `netbox/ipam/fields.py` (+2 -0) 📝 `netbox/ipam/filters.py` (+15 -3) 📝 `netbox/ipam/lookups.py` (+9 -0) 📝 `netbox/ipam/managers.py` (+1 -1) ➕ `netbox/ipam/migrations/0035_drop_ip_family.py` (+38 -0) 📝 `netbox/ipam/models.py` (+26 -32) 📝 `netbox/ipam/tests/test_filters.py` (+26 -26) 📝 `netbox/ipam/tests/test_models.py` (+47 -48) 📝 `netbox/ipam/tests/test_ordering.py` (+81 -81) 📝 `netbox/ipam/tests/test_views.py` (+9 -10) 📝 `netbox/ipam/views.py` (+1 -1) 📝 `netbox/templates/ipam/aggregate.html` (+1 -1) 📝 `netbox/templates/ipam/ipaddress.html` (+1 -1) 📝 `netbox/templates/ipam/prefix.html` (+1 -1) 📝 `netbox/templates/utilities/obj_list.html` (+2 -2) 📝 `netbox/utilities/views.py` (+1 -5) 📝 `netbox/virtualization/forms.py` (+2 -2) </details> ### 📄 Description ### Fixes: #4081 Remove the `family` field from the Aggregate, Prefix, and IPAddress models. This does **not** have any effect on the REST API or filter parameters. However, it does remove `family` as a field lookup in the Django ORM. Use the `__family` lookup filter now instead: ``` >>> Prefix.objects.filter(prefix__family=6) ``` --- <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:35 +01:00
adam closed this issue 2025-12-29 22:23:35 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12783