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

Method _has_data

mongoengine/queryset/base.py:214–217  ·  view source on GitHub ↗

Return True if cursor has any data.

(self)

Source from the content-addressed store, hash-verified

212 raise NotImplementedError
213
214 def _has_data(self):
215 """Return True if cursor has any data."""
216 queryset = self.order_by()
217 return False if queryset.first() is None else True
218
219 def __bool__(self):
220 """Avoid to open all records in an if stmt in Py3."""

Callers 2

__bool__Method · 0.95

Calls 2

order_byMethod · 0.95
firstMethod · 0.45