Skip to content

Conversation

@pheus
Copy link
Contributor

@pheus pheus commented Dec 16, 2025

Fixes: #20900

This PR improves the UX for filtering on Selection-type custom fields by allowing users to pick multiple values in the filter form, while keeping the field single-valued everywhere else.

  • Add a for_filterset_form flag to CustomField.to_form_field() so filter forms can request filter-specific field/widget behavior.
  • When for_filterset_form=True, render Selection custom fields using a multi-select field/widget (without changing create/edit/bulk-edit behavior).
  • Update NetBoxModelFilterSetForm to pass for_filterset_form=True when constructing custom-field-backed filter fields.
Add a `for_filterset_form` flag to `CustomField.to_form_field()` to allow building form fields/widgets tailored specifically for FilterSet forms. Update NetBoxModelFilterSetForm to use this flag for improved custom field filtering. Fixes netbox-community#20900
@jeremystretch jeremystretch requested review from a team and jnovinger and removed request for a team December 17, 2025 18:42
@jnovinger jnovinger merged commit 5c6aaf2 into netbox-community:main Dec 17, 2025
7 checks passed
@pheus pheus deleted the 20900-add-customfield-multiselect-filterform branch December 17, 2025 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants