Commits

fak3 committed bd180ef

orders/models.py - fix iter_bulk

  • Participants
  • Parent commits efc7061

Comments (0)

Files changed (1)

         if filters:
             BULK_SIZE = 100
             key, values = filters.popitem()
-            for i in xrange(0, len(values), BULK_SIZE):
+            for i in xrange(0, len(values)+BULK_SIZE, BULK_SIZE):
                 for obj in self.filter(**{key: values[i:i+BULK_SIZE]}):
                     yield obj
         else:
             BULK_SIZE = 1000
-            for i in xrange(0, self.count(), BULK_SIZE):
+            for i in xrange(0, self.count()+BULK_SIZE, BULK_SIZE):
                 for obj in self[i:i+BULK_SIZE]:
                     yield obj