Plugin filter searching not working - NetboxModelFilterSet #9923
-
I'm not able to search my models (yes, they are using the NetboxModel class) using the FilterSets as defined in the documentation. No matter what I type in the search bar in the generic.ObjectListView for this model, it is not doing any filtering. What am I missing? Here's my View:
And here's the FilterSet:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
To enable general searching, you need to override NetBoxModelFilterSet's netbox/netbox/dcim/filtersets.py Lines 151 to 166 in a2e84dd |
Beta Was this translation helpful? Give feedback.
To enable general searching, you need to override NetBoxModelFilterSet's
search()
method and define the fields to search on. By default this returns the entire queryset. Here's an example from the Site model:netbox/netbox/dcim/filtersets.py
Lines 151 to 166 in a2e84dd