Merge pull request #201 from ramielrowe/master
Handling case of no data in 0003 migration
This commit is contained in:
@@ -41,6 +41,7 @@ def queryset_iterator(queryset, chunksize=1000):
|
||||
Note that the implementation of the iterator does not support ordered query sets.
|
||||
'''
|
||||
id = 0
|
||||
if queryset.order_by('-id').count() > 0:
|
||||
last_pk = queryset.order_by('-id')[0]['id']
|
||||
queryset = queryset.order_by('id')
|
||||
while id < last_pk:
|
||||
|
||||
Reference in New Issue
Block a user