paypal
[wolnelektury.git] / src / club / migrations / 0030_populate_method.py
1 # Generated by Django 2.2.19 on 2021-06-18 10:11
2
3 from django.db import migrations, models
4
5
6 def populate_method(apps, schema_editor):
7     Schedule = apps.get_model('club', 'Schedule')
8     Schedule.objects.filter(method='', monthly=False, yearly=False).update(method='payu')
9     Schedule.objects.filter(
10         models.Q(monthly=True) | models.Q(yearly=True),
11         method=''
12     ).update(method='payu-re')
13
14
15 class Migration(migrations.Migration):
16
17     dependencies = [
18         ('club', '0029_schedule_method'),
19     ]
20
21     operations = [
22         migrations.RunPython(populate_method, migrations.RunPython.noop)
23     ]