From aa41408dc1a7b5c94543d0d50fbcd34f501ab74b Mon Sep 17 00:00:00 2001 From: Stefano Fusai Date: Sun, 7 Jul 2024 17:01:42 +0200 Subject: [PATCH] Add TypeVar --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index a24884c..43746cf 100644 --- a/README.md +++ b/README.md @@ -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