Skip to content

Commit

Permalink
Add TypeVar
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanofusai committed Jul 7, 2024
1 parent 646d369 commit aa41408
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ class MyAPIView(...):
You can customize the search behavior by overriding the `_search` method.

```python
from typing import TypeVar

from drf_haystack_search_filter.filters import HaystackSearchFilter

T = TypeVar("T")


class MyHaystackSearchFilter(HaystackSearchFilter):
def _search(self, request: Request, queryset: QuerySet[T], view: APIView, query: str) -> QuerySet[T]:
# Customize the search behavior here
Expand Down

0 comments on commit aa41408

Please sign in to comment.