[PR #20072] [MERGED] Fixes #20012: Fix support for empty filter for custom fields #15817

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20072
Author: @jeremystretch
Created: 8/11/2025
Status: Merged
Merged: 8/21/2025
Merged by: @jnovinger

Base: mainHead: 20012-cf-empty-filter


📝 Commits (7)

  • 8ff2bc5 Introduce JSONEmpty lookup
  • 78b55b8 Fix inverted logic
  • b38a611 Use empty lookup for numeric custom fields instead of isnull
  • a821981 Add custom field tests for empty lookup
  • 37abb4c Fix multiselect and multi-object CF filters
  • e01125a Revert FILTER_NUMERIC_BASED_LOOKUP_MAP change
  • 004bb69 Override isnull lookup for custom fields

📊 Changes

4 files changed (+55 additions, -4 deletions)

View changed files

📝 netbox/extras/lookups.py (+27 -1)
📝 netbox/extras/models/customfields.py (+9 -1)
📝 netbox/extras/tests/test_customfields.py (+11 -1)
📝 netbox/netbox/filtersets.py (+8 -1)

📄 Description

Fixes: #20012

  • Introduce JSONEmpty specifically for JSON fields
  • Ensure that a BooleanFilter is used for the empty lookup expression

🔄 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/20072 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 8/11/2025 **Status:** ✅ Merged **Merged:** 8/21/2025 **Merged by:** [@jnovinger](https://github.com/jnovinger) **Base:** `main` ← **Head:** `20012-cf-empty-filter` --- ### 📝 Commits (7) - [`8ff2bc5`](https://github.com/netbox-community/netbox/commit/8ff2bc5dff2c73352be6c9ae64d97c48f889869b) Introduce JSONEmpty lookup - [`78b55b8`](https://github.com/netbox-community/netbox/commit/78b55b8515cfc35065e27d029c52d3cf091a5c7a) Fix inverted logic - [`b38a611`](https://github.com/netbox-community/netbox/commit/b38a6116227c2162586007506007f63461b97c7f) Use empty lookup for numeric custom fields instead of isnull - [`a821981`](https://github.com/netbox-community/netbox/commit/a821981d276b9986293ada9c6f106ddfef42dd5e) Add custom field tests for empty lookup - [`37abb4c`](https://github.com/netbox-community/netbox/commit/37abb4c8a865379c90e716efb991a5bbdcd32586) Fix multiselect and multi-object CF filters - [`e01125a`](https://github.com/netbox-community/netbox/commit/e01125a2adba59cba09f1a246976595578ba4114) Revert FILTER_NUMERIC_BASED_LOOKUP_MAP change - [`004bb69`](https://github.com/netbox-community/netbox/commit/004bb69aa1478c925a8b037cb0c9d146bc0e7c86) Override isnull lookup for custom fields ### 📊 Changes **4 files changed** (+55 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/lookups.py` (+27 -1) 📝 `netbox/extras/models/customfields.py` (+9 -1) 📝 `netbox/extras/tests/test_customfields.py` (+11 -1) 📝 `netbox/netbox/filtersets.py` (+8 -1) </details> ### 📄 Description ### Fixes: #20012 - Introduce `JSONEmpty` specifically for JSON fields - Ensure that a `BooleanFilter` is used for the `empty` lookup expression --- <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:24:14 +01:00
adam closed this issue 2025-12-30 00:24:14 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15817