0009_translations.py 2.69 KB
Newer Older
1
# -*- coding: utf-8 -*-
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
2
# Generated by Django 1.10 on 2016-09-06 17:31
3
4
5
from __future__ import unicode_literals

from django.db import migrations, models
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
6
import django.db.models.manager
7
8
9


class Migration(migrations.Migration):
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
10

11
    dependencies = [
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
12
        ('activemembers', '0008_auto_20160906_1015'),
13
14
15
16
17
18
19
    ]

    def forwards_func(apps, schema_editor):
        Committee = apps.get_model("activemembers", "committee")
        db_alias = schema_editor.connection.alias
        for committee in Committee.unfiltered_objects.using(db_alias).all():
            committee.name_en = committee.name_nl
20
            committee.description_en = committee.description_nl
21
22
23
24
25
26
            committee.save()

    def reverse_func(apps, schema_editor):
        pass

    operations = [
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
27
28
29
30
31
32
        migrations.AlterModelManagers(
            name='committee',
            managers=[
                ('unfiltered_objects', django.db.models.manager.Manager()),
            ],
        ),
33
        migrations.RenameField('committee', 'name', 'name_nl'),
34
        migrations.RenameField('committee', 'description', 'description_nl'),
35
36
37
38
39
40
41
42
43
44
45
46
47
48
        migrations.AddField(
            model_name='committee',
            name='name_en',
            field=models.CharField(default='', max_length=40, unique=True,
                                   verbose_name='Committee name (EN)'),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='committee',
            name='name_nl',
            field=models.CharField(max_length=40, unique=True,
                                   verbose_name='Committee name (NL)'),
            preserve_default=True,
        ),
49
50
51
        migrations.AddField(
            model_name='committee',
            name='description_en',
52
            field=models.TextField(default='', verbose_name='Description (EN)'),
53
54
55
56
57
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='committee',
            name='description_nl',
58
            field=models.TextField(verbose_name='Description (NL)'),
59
60
            preserve_default=True,
        ),
61
62
63
64
65
66
67
68
69
70
71
        migrations.RenameField('committeemembership', 'role', 'role_nl'),
        migrations.AddField(
            model_name='committeemembership',
            name='role_en',
            field=models.CharField(blank=True, help_text='The role of this member', max_length=255, null=True, verbose_name='role (EN)'),
        ),
        migrations.AlterField(
            model_name='committeemembership',
            name='role_nl',
            field=models.CharField(blank=True, help_text='The role of this member', max_length=255, null=True, verbose_name='role (NL)'),
        ),
72
        migrations.RunPython(forwards_func, reverse_func),
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
73
    ]