def __nonzero__(self):
        if self._result_cache is not None:
            return bool(self._result_cache)
        try:
            iter(self).next()
        except __HOLE__:
            return False
        return True
dataset/ETHPy150Open dcramer/django-compositepks/django/db/models/query.py/QuerySet.__nonzero__