1 # Generated by Django 2.2.27 on 2022-08-26 12:39
3 from django.db import migrations
6 def move_amounts(apps, schema_editor):
7 Club = apps.get_model('club', 'Club')
8 for club in Club.objects.all():
9 for amount in [int(x) for x in club.single_amounts.split(',')]:
10 club.singleamount_set.create(amount=amount)
11 for amount in [int(x) for x in club.monthly_amounts.split(',')]:
12 club.monthlyamount_set.create(amount=amount)
15 def move_amounts_back(apps, schema_editor):
16 Club = apps.get_model('club', 'Club')
17 for club in Club.objects.all():
18 club.single_amounts = ','.join(
20 club.singleamount_set.order_by('amount')
22 club.monthly_amounts = ','.join(
24 club.monthlyamount_set.order_by('amount')
29 class Migration(migrations.Migration):
32 ('club', '0040_amount'),