add a filter
[wolnelektury.git] / src / club / migrations / 0043_monthlyamount_wide_singleamount_wide.py
1 # Generated by Django 4.0.8 on 2023-05-08 12:46
2
3 from django.db import migrations, models
4
5
6 def last_amount_wide(apps, schema_editor):
7     SingleAmount = apps.get_model('club', 'SingleAmount')
8     a = SingleAmount.objects.last()
9     if a is not None:
10         a.wide = True
11         a.save()
12
13
14 class Migration(migrations.Migration):
15
16     dependencies = [
17         ('club', '0042_auto_20220826_1458'),
18     ]
19
20     operations = [
21         migrations.AddField(
22             model_name='monthlyamount',
23             name='wide',
24             field=models.BooleanField(default=False),
25         ),
26         migrations.AddField(
27             model_name='singleamount',
28             name='wide',
29             field=models.BooleanField(default=False),
30         ),
31         migrations.RunPython(
32             last_amount_wide,
33             migrations.RunPython.noop
34         )
35     ]