MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / QuerySetNoCache

Class QuerySetNoCache

mongoengine/queryset/queryset.py:159–189  ·  view source on GitHub ↗

A non caching QuerySet

Source from the content-addressed store, hash-verified

157
158
159class QuerySetNoCache(BaseQuerySet):
160 """A non caching QuerySet"""
161
162 def cache(self):
163 """Convert to a caching queryset"""
164 return self._clone_into(QuerySet(self._document, self._collection))
165
166 def __repr__(self):
167 """Provides the string representation of the QuerySet"""
168 if self._iter:
169 return ".. queryset mid-iteration .."
170
171 data = []
172 for _ in range(REPR_OUTPUT_SIZE + 1):
173 try:
174 data.append(next(self))
175 except StopIteration:
176 break
177
178 if len(data) > REPR_OUTPUT_SIZE:
179 data[-1] = "...(remaining elements truncated)..."
180
181 self.rewind()
182 return repr(data)
183
184 def __iter__(self):
185 queryset = self
186 if queryset._iter:
187 queryset = self.clone()
188 queryset.rewind()
189 return queryset

Callers 1

no_cacheMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected