0051_optionaltopologie_vlan_non_member.py 978 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2018-09-01 10:41
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion

def init_vlan_non_member(apps, schema_editor):
    OptionalTopologie = apps.get_model('preferences', 'OptionalTopologie')
    option, _created = OptionalTopologie.objects.get_or_create()
    option.vlan_non_member = option.vlan_decision_nok
    option.save()

class Migration(migrations.Migration):

    dependencies = [
        ('machines', '0094_auto_20180815_1918'),
        ('preferences', '0050_auto_20180818_1329'),
    ]

    operations = [
        migrations.AddField(
            model_name='optionaltopologie',
            name='vlan_non_member',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='decision_non_member', to='machines.Vlan'),
        ),
        migrations.RunPython(init_vlan_non_member)
    ]