-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support filter lookups for custom fields #6615
Labels
status: accepted
This issue has been accepted for implementation
type: feature
Introduction of new functionality to the application
Milestone
Comments
This was referenced Jun 16, 2021
This was referenced Oct 28, 2021
jeremystretch
added a commit
that referenced
this issue
Oct 29, 2021
Closes #6615: Enable filter lookups for custom fields
jeremystretch
added a commit
that referenced
this issue
Oct 29, 2021
Merged
sol1james
added a commit
to sol1james/netbox
that referenced
this issue
Dec 20, 2021
Netbox now supports lookup expressions on custom fields netbox-community#6615
sol1james
added a commit
to sol1james/netbox
that referenced
this issue
Jan 4, 2022
Documenting feature netbox-community#6615
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
status: accepted
This issue has been accepted for implementation
type: feature
Introduction of new functionality to the application
NetBox version
v2.11.6
Feature type
Change to existing functionality
Proposed functionality
Extend NetBox's filtering functionality to automatically generate lookup filters for a model's custom fields. For example, a custom field named
foo
applied to the dcim.Site model will result in a filter namedcf_foo
on SiteFilterSet. This filter will support either an exact match or anicontains
lookup, depending on how the CustomField is configured. However, it will not support any further lookup logic, such as greater/less than evaluation for integers.Implementing this feature would comprise automatically generating appropriate lookups for a custom field depending on its type. For example, integer fields should get
__lt
,__lte
,__gt
,__gte
, and similar lookups. This might be done by extending either BaseFilterSet or the CustomFieldFilter class,Use case
This extension of the existing filtering logic would enable users to filter on custom fields with the same degree of flexibility afforded to built-in model fields.
Database changes
No response
External dependencies
No response
The text was updated successfully, but these errors were encountered: