f36eb0742c83d16d4d2f4b8838d7e6cc0c06d0c9
[wolnelektury.git] / apps / catalogue / migrations / 0006_auto_20141022_1059.py
1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals
3
4 from django.db import models, migrations
5
6
7 def capitalize_objects(apps, schema_editor):
8     """Capitalize Polish names of things."""
9     Tag = apps.get_model('catalogue', 'Tag')
10     for tag in Tag.objects.filter(category='thing'):
11         tag.name = tag.name_pl = tag.name.capitalize()
12         tag.save()
13
14
15 class Migration(migrations.Migration):
16
17     dependencies = [
18         ('catalogue', '0005_auto_20141016_1337'),
19     ]
20
21     operations = [
22         migrations.RunPython(capitalize_objects),
23     ]