update translation
[redakcja.git] / apps / catalogue / migrations / 0011_document_published.py
1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals
3
4 from django.db import migrations, models
5
6
7 def set_published(apps, schema_editor):
8     Document = apps.get_model('catalogue', 'Document')
9     Document.objects.exclude(publish_log=None).update(published=True)
10
11
12 class Migration(migrations.Migration):
13
14     dependencies = [
15         ('catalogue', '0010_auto_20170119_1321'),
16     ]
17
18     operations = [
19         migrations.AddField(
20             model_name='document',
21             name='published',
22             field=models.BooleanField(default=False),
23         ),
24         migrations.RunPython(set_published),
25     ]