mirror of
https://github.com/django/django.git
synced 2025-07-05 18:29:11 +00:00
queryset-refactor: Rewrote [7417] so that it involves less overall indentation.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7419 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
01b7a16ef0
commit
81b3043827
@ -67,13 +67,13 @@ class _QuerySet(object):
|
||||
self._fill_cache()
|
||||
|
||||
def __nonzero__(self):
|
||||
if self._result_cache is None:
|
||||
if self._result_cache is not None:
|
||||
return bool(self._result_cache)
|
||||
try:
|
||||
iter(self).next()
|
||||
except StopIteration:
|
||||
return False
|
||||
return True
|
||||
return bool(self._result_cache)
|
||||
|
||||
def __getitem__(self, k):
|
||||
"Retrieve an item or slice from the set of results."
|
||||
|
Loading…
x
Reference in New Issue
Block a user