From 06a89055c4ed951eb78b8ece725a08efca5387a3 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Sat, 25 Mar 2017 10:46:18 -0300 Subject: [PATCH] Simpler migration --- kfet/migrations/0049_remove_checkout.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/kfet/migrations/0049_remove_checkout.py b/kfet/migrations/0049_remove_checkout.py index 29d15676..8328c9c4 100644 --- a/kfet/migrations/0049_remove_checkout.py +++ b/kfet/migrations/0049_remove_checkout.py @@ -6,13 +6,9 @@ from django.db import migrations, models def adapt_operation_types(apps, schema_editor): Operation = apps.get_model("kfet", "Operation") - edits = Operation.objects.filter( + Operation.objects.filter( is_checkout=False, - type__in=['withdraw', 'deposit']) - - for ope in edits: - ope.type = 'edit' - ope.save() + type__in=['withdraw', 'deposit']).update(type='edit') def revert_operation_types(apps, schema_editor):