Determines the behavior when no query was found. By default, no results are returned (``EmptySearchQuerySet``). Should you want to show all results, override this method in your own ``SearchForm`` subclass and do ``return self.searchqueryset.all()``.
(self)
| 35 | super().__init__(*args, **kwargs) |
| 36 | |
| 37 | def no_query_found(self): |
| 38 | """ |
| 39 | Determines the behavior when no query was found. |
| 40 | |
| 41 | By default, no results are returned (``EmptySearchQuerySet``). |
| 42 | |
| 43 | Should you want to show all results, override this method in your |
| 44 | own ``SearchForm`` subclass and do ``return self.searchqueryset.all()``. |
| 45 | """ |
| 46 | return EmptySearchQuerySet() |
| 47 | |
| 48 | def search(self): |
| 49 | if not self.is_valid(): |
no test coverage detected