Simpler migration

This commit is contained in:
Ludovic Stephan 2017-03-25 10:46:18 -03:00
parent 9a081ddae0
commit 06a89055c4

View file

@ -6,13 +6,9 @@ from django.db import migrations, models
def adapt_operation_types(apps, schema_editor): def adapt_operation_types(apps, schema_editor):
Operation = apps.get_model("kfet", "Operation") Operation = apps.get_model("kfet", "Operation")
edits = Operation.objects.filter( Operation.objects.filter(
is_checkout=False, is_checkout=False,
type__in=['withdraw', 'deposit']) type__in=['withdraw', 'deposit']).update(type='edit')
for ope in edits:
ope.type = 'edit'
ope.save()
def revert_operation_types(apps, schema_editor): def revert_operation_types(apps, schema_editor):