Ticket #2430: nonzero_fix.diff
File nonzero_fix.diff, 507 bytes (added by , 17 years ago) |
---|
-
django/db/models/query.py
109 109 110 110 def __len__(self): 111 111 return len(self._get_data()) 112 113 def __nonzero__(self): 114 try: 115 self.__getitem__(0) 116 return True 117 except IndexError: 118 return False 112 119 113 120 def __iter__(self): 114 121 return iter(self._get_data())