Skip to content
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

nautobot.utilities.filters.BaseFilterSet.FILTER_DEFAULTS does not allow models.TextField to use multi-value filtering #477

Closed
lampwins opened this issue May 24, 2021 · 1 comment · Fixed by #1223
Labels
type: bug Something isn't working as expected

Comments

@lampwins
Copy link
Member

lampwins commented May 24, 2021

Environment

  • Python version: 3.9
  • Nautobot version: 1.0.1

Steps to Reproduce

  1. Create a model with a models.TextField
  2. Create a filterset that exposes this field
  3. Attempt to filter this field with multiple values

Expected Behavior

The filterset should implement the standard MultiValueCharFilter filter class capabilities, allowing for multi-value search using an OR condition.

Observed Behavior

The field only supports single-value search.

This is because nautobot.utilities.filters.BaseFilterSet.FILTER_DEFAULTS does not update the filter_class to use MultiValueCharFilter.

@lampwins lampwins added status: accepted type: bug Something isn't working as expected labels May 24, 2021
@glennmatthews
Copy link
Contributor

Should be a pretty straightforward change to FILTER_DEFAULTS. I don't think this will impact the REST API, though it may impact FilterForms for the affected fields?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants