MCPcopy Index your code
hub / github.com/django-haystack/django-haystack / __len__

Method __len__

haystack/query.py:80–89  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

78 return "<SearchQuerySet: query=%r, using=%r>" % (self.query, self._using)
79
80 def __len__(self):
81 if self._result_count is None:
82 self._result_count = self.query.get_count()
83
84 # Some backends give weird, false-y values here. Convert to zero.
85 if not self._result_count:
86 self._result_count = 0
87
88 # This needs to return the actual number of hits, not what's in the cache.
89 return self._result_count - self._ignored_result_count
90
91 def __iter__(self):
92 if self._cache_is_full():

Callers

nothing calls this directly

Calls 1

get_countMethod · 0.80

Tested by

no test coverage detected