Using first() from cloned queryset

This commit is contained in:
Jonathan Prates 2014-05-28 17:26:28 -03:00
parent 39735594bd
commit c87801f0a9

View File

@ -159,11 +159,7 @@ class BaseQuerySet(object):
queryset = self.clone()
queryset._ordering = []
try:
queryset[0]
return True
except IndexError:
return False
return False if queryset.first() is None else True
def __nonzero__(self):
""" Same behaviour in Py2 """