1 # This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
4 from django.db import migrations
7 def legacy_group(apps, schema_editor):
8 Cite = apps.get_model('social', 'Cite')
9 BannerGroup = apps.get_model('social', 'BannerGroup')
11 traditional = BannerGroup.objects.create(name='Tradycyjne cytaty')
12 banners = BannerGroup.objects.create(name='Bannery')
14 Cite.objects.exclude(book=None).update(group=traditional)
15 Cite.objects.filter(book=None).update(group=banners)
18 class Migration(migrations.Migration):
21 ('social', '0005_auto_20190318_1309'),
27 migrations.RunPython.noop