fixing #336
This commit is contained in:
		| @@ -1609,10 +1609,16 @@ class QuerySet(object): | |||||||
|  |  | ||||||
|     def __repr__(self): |     def __repr__(self): | ||||||
|         limit = REPR_OUTPUT_SIZE + 1 |         limit = REPR_OUTPUT_SIZE + 1 | ||||||
|         if self._limit is not None and self._limit < limit: |         start = ( 0 if self._skip is None else self._skip ) | ||||||
|             limit = self._limit |         if self._limit is None: | ||||||
|  |             stop = start + limit | ||||||
|  |         if self._limit is not None: | ||||||
|  |             if self._limit - start > limit: | ||||||
|  |                 stop = start + limit | ||||||
|  |             else: | ||||||
|  |                 stop = self._limit | ||||||
|         try: |         try: | ||||||
|             data = list(self[self._skip:limit]) |             data = list(self[start:stop]) | ||||||
|         except pymongo.errors.InvalidOperation: |         except pymongo.errors.InvalidOperation: | ||||||
|             return ".. queryset mid-iteration .." |             return ".. queryset mid-iteration .." | ||||||
|         if len(data) > REPR_OUTPUT_SIZE: |         if len(data) > REPR_OUTPUT_SIZE: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user