1
0
mirror of https://github.com/django/django.git synced 2025-07-06 02:39:12 +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() self._fill_cache()
def __nonzero__(self): def __nonzero__(self):
if self._result_cache is None: if self._result_cache is not None:
return bool(self._result_cache)
try: try:
iter(self).next() iter(self).next()
except StopIteration: except StopIteration:
return False return False
return True return True
return bool(self._result_cache)
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."