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()
|
self._fill_cache()
|
||||||
|
|
||||||
def __nonzero__(self):
|
def __nonzero__(self):
|
||||||
if self._result_cache is None:
|
if self._result_cache is not None:
|
||||||
try:
|
return bool(self._result_cache)
|
||||||
iter(self).next()
|
try:
|
||||||
except StopIteration:
|
iter(self).next()
|
||||||
return False
|
except StopIteration:
|
||||||
return True
|
return False
|
||||||
return bool(self._result_cache)
|
return True
|
||||||
|
|
||||||
def __getitem__(self, k):
|
def __getitem__(self, k):
|
||||||
"Retrieve an item or slice from the set of results."
|
"Retrieve an item or slice from the set of results."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user