[PR #10488] [MERGED] Closes #9249: Ignore case for device/VM names #13645

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/10488
Author: @jeremystretch
Created: 9/27/2022
Status: Merged
Merged: 9/28/2022
Merged by: @jeremystretch

Base: featureHead: 9249-device-vm-names


📝 Commits (3)

📊 Changes

11 files changed (+76 additions, -16 deletions)

View changed files

📝 docs/release-notes/version-3.4.md (+5 -0)
📝 netbox/dcim/filtersets.py (+4 -1)
📝 netbox/dcim/migrations/0162_unique_constraints.py (+3 -2)
📝 netbox/dcim/models/devices.py (+3 -2)
📝 netbox/dcim/tests/test_filtersets.py (+3 -0)
📝 netbox/dcim/tests/test_models.py (+21 -0)
📝 netbox/virtualization/filtersets.py (+5 -2)
📝 netbox/virtualization/migrations/0033_unique_constraints.py (+3 -2)
📝 netbox/virtualization/models.py (+4 -3)
📝 netbox/virtualization/tests/test_filtersets.py (+3 -0)
📝 netbox/virtualization/tests/test_models.py (+22 -4)

📄 Description

Closes: #9249

  • Adjust the uniqueness constraints on the Device and VirtualMachine models to use the Lower('name') expression rather than the raw name value.
  • Adjust the name filters for Device and Virtual Machine to use the case-insensitive iexact lookup.
  • Add relevant model and filter 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/10488 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 9/27/2022 **Status:** ✅ Merged **Merged:** 9/28/2022 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `9249-device-vm-names` --- ### 📝 Commits (3) - [`1d4f828`](https://github.com/netbox-community/netbox/commit/1d4f828b93550a09b4842c7a985f5394df6ef2a9) Device/VM unique constraints ignore case for name field - [`e977333`](https://github.com/netbox-community/netbox/commit/e977333177798cdf09a0ee4d8285908fb596d5e9) Update device/VM name filters to be case-insensitive - [`ad6a708`](https://github.com/netbox-community/netbox/commit/ad6a7086c42779dcc91bde801126caac1a4afa1a) Changelog for #9249 ### 📊 Changes **11 files changed** (+76 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `docs/release-notes/version-3.4.md` (+5 -0) 📝 `netbox/dcim/filtersets.py` (+4 -1) 📝 `netbox/dcim/migrations/0162_unique_constraints.py` (+3 -2) 📝 `netbox/dcim/models/devices.py` (+3 -2) 📝 `netbox/dcim/tests/test_filtersets.py` (+3 -0) 📝 `netbox/dcim/tests/test_models.py` (+21 -0) 📝 `netbox/virtualization/filtersets.py` (+5 -2) 📝 `netbox/virtualization/migrations/0033_unique_constraints.py` (+3 -2) 📝 `netbox/virtualization/models.py` (+4 -3) 📝 `netbox/virtualization/tests/test_filtersets.py` (+3 -0) 📝 `netbox/virtualization/tests/test_models.py` (+22 -4) </details> ### 📄 Description ### Closes: #9249 - Adjust the uniqueness constraints on the Device and VirtualMachine models to use the `Lower('name')` expression rather than the raw `name` value. - Adjust the `name` filters for Device and Virtual Machine to use the case-insensitive `iexact` lookup. - Add relevant model and filter 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-29 23:20:02 +01:00
adam closed this issue 2025-12-29 23:20:02 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13645