-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
NetBox version
v4.3.4
Feature type
Change to existing functionality
Proposed functionality
Now we have the following filter lookups for string fields in NetBox:
- n
- ic
- nic
- isw
- nisw
- iew
- niew
- ie
- nie
- empty
I want to add support for regex
and iregex
Django ORM lookups in filters for string fields.
It can be easily done by adding them to FILTER_CHAR_BASED_LOOKUP_MAP
variable in netbox/utilities/constants.py.
I've tested this on my local NetBox deployment, and it's working well.
Use case
At my company, we have a specific naming convention, and in some cases, it's challenging to filter devices by name using existing lookups. Therefore, I propose this feature.
Also, regex
and iregex
are built-in Django ORM lookups, and PostgreSQL fully supports them.
Now, only GraphQL supports these lookups, adding regex lookups will make filtering in other interfaces more consistent.
If the feature is accepted, you can assign it to me, and I will make a PR with updates for code, tests, and docs.
Database changes
No database changes
External dependencies
No response