Filter objects with select/multiselect custom fields by choice PK #5552
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #5009
What's Changed
Added the option to filter objects with select/multi-select custom fields based on the UUID of the defined custom field choice(s), for example
/api/dcim/locations/?cf_multiselect=1ea9237c-3ba7-4985-ba7e-6fd9e9bff813
as an alternative to/api/dcim/locations/?cf_multiselect=some-choice-value
.CustomFieldSelectFilter
class with customget_filter_predicate()
implementationCustomFieldMultiSelectFilter
to be a subclass ofCustomFieldSelectFilter
CustomFieldMultiValueSelectFilter
as it's confusing, totally unused, and not part of the apps namespace.Changed extended filter for multi-select custom fields fromreverted this out of caution__n
to__nic
to match the fact that the base filter here isicontains
, notexact
. (I'm second-guessing this now, but it "feels" like a bug fix - thoughts??)Screenshots
TODO