A stubbed SearchQuerySet that behaves as normal but always returns no results.
| 634 | |
| 635 | |
| 636 | class EmptySearchQuerySet(SearchQuerySet): |
| 637 | """ |
| 638 | A stubbed SearchQuerySet that behaves as normal but always returns no |
| 639 | results. |
| 640 | """ |
| 641 | |
| 642 | def __len__(self): |
| 643 | return 0 |
| 644 | |
| 645 | def _cache_is_full(self): |
| 646 | # Pretend the cache is always full with no results. |
| 647 | return True |
| 648 | |
| 649 | def _clone(self, klass=None): |
| 650 | clone = super()._clone(klass=klass) |
| 651 | clone._result_cache = [] |
| 652 | return clone |
| 653 | |
| 654 | def _fill_cache(self, start, end): |
| 655 | return False |
| 656 | |
| 657 | def facet_counts(self): |
| 658 | return {} |
| 659 | |
| 660 | |
| 661 | class ValuesListSearchQuerySet(SearchQuerySet): |
no outgoing calls
searching dependent graphs…