1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals
4 from django.db import migrations, models
7 def set_published(apps, schema_editor):
8 Document = apps.get_model('catalogue', 'Document')
9 Document.objects.exclude(publish_log=None).update(published=True)
12 class Migration(migrations.Migration):
15 ('catalogue', '0010_auto_20170119_1321'),
20 model_name='document',
22 field=models.BooleanField(default=False),
24 migrations.RunPython(set_published),