<filename>lab/migrations/0003_auto_20191202_1534.py
# Generated by Django 2.2.8 on 2019-12-02 15:34

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


def initial_os_data(app, schema_editor):
    data = [
        {"os": "ios", "os_type": "cisco_ios", "term_length": "terminal length 0", "fetch_config": "show running-config"},
        {"os": "iosxr", "os_type": "cisco_xr", "term_length": "terminal length 0", "fetch_config": "show running-config"},
        {"os": "iosxe", "os_type": "cisco_xe", "term_length": "terminal length 0", "fetch_config": "show running-config"},
        {"os": "nxos", "os_type": "cisco_nxos", "term_length": "terminal length 0", "fetch_config": "show running-config"},
        {"os": "eos", "os_type": "arista_eos", "term_length": "terminal length 0", "fetch_config": "show running-config"},
        {"os": "edgeos", "os_type": "vyos", "term_length": "terminal length 0", "fetch_config": "show configuration"},
    ]

    for item in data:
        OperatingSystem.objects.create(
            name=item['os'],
            netmiko_type=item['os_type'],
            terminal_length_cmd=item['term_length'],
            fetch_config_cmd=item['fetch_config']
        )


class Migration(migrations.Migration):

    dependencies = [
        ('lab', '0002_auto_20191120_1951'),
    ]

    operations = [
        migrations.CreateModel(
            name='OperatingSystem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('netmiko_type', models.CharField(max_length=255)),
                ('terminal_length_cmd', models.CharField(max_length=255)),
                ('fetch_config_cmd', models.CharField(max_length=255)),
            ],
        ),
        migrations.AlterField(
            model_name='device',
            name='os_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='lab.OperatingSystem'),
        ),
        migrations.RunPython(initial_os_data),
    ]

<filename>lab/migrations/0003_auto_20191202_1534.py
# Generated by Django 2.2.8 on 2019-12-02 15:34

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


def initial_os_data(app, schema_editor):
    data = [
        {"os": "ios", "os_type": "cisco_ios", "term_length": "terminal length 0", "fetch_config": "show running-config"},
        {"os": "iosxr", "os_type": "cisco_xr", "term_length": "terminal length 0", "fetch_config": "show running-config"},
        {"os": "iosxe", "os_type": "cisco_xe", "term_length": "terminal length 0", "fetch_config": "show running-config"},
        {"os": "nxos", "os_type": "cisco_nxos", "term_length": "terminal length 0", "fetch_config": "show running-config"},
        {"os": "eos", "os_type": "arista_eos", "term_length": "terminal length 0", "fetch_config": "show running-config"},
        {"os": "edgeos", "os_type": "vyos", "term_length": "terminal length 0", "fetch_config": "show configuration"},
    ]

    for item in data:
        OperatingSystem.objects.create(
            name=item['os'],
            netmiko_type=item['os_type'],
            terminal_length_cmd=item['term_length'],
            fetch_config_cmd=item['fetch_config']
        )


class Migration(migrations.Migration):

    dependencies = [
        ('lab', '0002_auto_20191120_1951'),
    ]

    operations = [
        migrations.CreateModel(
            name='OperatingSystem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('netmiko_type', models.CharField(max_length=255)),
                ('terminal_length_cmd', models.CharField(max_length=255)),
                ('fetch_config_cmd', models.CharField(max_length=255)),
            ],
        ),
        migrations.AlterField(
            model_name='device',
            name='os_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='lab.OperatingSystem'),
        ),
        migrations.RunPython(initial_os_data),
    ]

# Generated by Django 2.2.8 on 2019-12-02 15:34