Skip to content

Conversation

991jo
Copy link
Contributor

@991jo 991jo commented Oct 4, 2025

Fixes: #20499

@jeremystretch jeremystretch requested review from a team and jnovinger and removed request for a team October 7, 2025 12:31
Copy link
Member

@jnovinger jnovinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the doc additions, @991jo . It's much appreciated!

I made some notes here and below:

  1. Let's clarify that the "Quick Search" field is the UI field, not the field in the filter or the method name.
  2. Your sentences appear to all be on a separate line, is there some reason to not have them on the same line and let MkDocs figure out the wrapping?

filterset_class = filtersets.MyModelFilterSet
```

### Search function for use by the ObjectListView quick search
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Search function for use by the ObjectListView quick search
### Implementing Quick Search

Q(description__icontains=value)
)
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some things that I think are worth mentioning:

  1. NetBoxModelFilterSet.search() is already implemented and just returns the queryset unmodified, which is why it needs to be over-ridden here.
  2. For context, the search() method is called as a result of the q filter, which is already wire up in NetBoxModelFilterSet and does not need to be over-ridden here unless different behavior is required.

### Search function for use by the ObjectListView quick search

The `ObjectListView` has a field called Quick Search.
For this field to work the corresponding FilterSet has to implement the `search` function.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For this field to work the corresponding FilterSet has to implement the `search` function.
For Quick Search to work the corresponding FilterSet has to implement the `search` method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The Plugins development documentation does not explain the ObjectListView quick search function.

2 participants