Skip to content

Commit 79bf274

Browse files
committed
fix offset calc
1 parent cf7df6b commit 79bf274

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

mirage/tools.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ def executor(self, apps=None, schema_editor=None, offset=0, total=None, limit=10
7777
execute_sql += f"update {db_table} set {self.tofield}='{value[1]}' where id='{value[0]}';"
7878
cursor.execute(execute_sql)
7979
if value_list:
80-
t.update(value_list[-1][0] - offset)
81-
offset = value_list[-1][0]
80+
if limit == -1:
81+
t.update(len(value_list) - offset)
82+
else:
83+
t.update(value_list[-1][0] - offset)
84+
offset = value_list[-1][0]
8285
t.close()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
88
setup(
99
name='django-mirage-field',
10-
version='1.1.4',
10+
version='1.1.5',
1111
install_requires=[
1212
"cryptography",
1313
"tqdm",

0 commit comments

Comments
 (0)