1
0
mirror of https://github.com/django/django.git synced 2025-07-05 10:19:20 +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:
Malcolm Tredinnick 2008-04-13 04:49:41 +00:00
parent 01b7a16ef0
commit 81b3043827

View File

@ -67,13 +67,13 @@ class _QuerySet(object):
self._fill_cache()
def __nonzero__(self):
if self._result_cache is None:
try:
iter(self).next()
except StopIteration:
return False
return True
return bool(self._result_cache)
if self._result_cache is not None:
return bool(self._result_cache)
try:
iter(self).next()
except StopIteration:
return False
return True
def __getitem__(self, k):
"Retrieve an item or slice from the set of results."