code: def count(self):
          
          if self._result_cache is not None and not self._iter:
              return len(self._result_cache)
  
          return self.query.get_count()
docs: Returns the number of records as an integer.
  
          If the QuerySet is already fully cached this simply returns the length
          of the cached results set to avoid an api call.