# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-04 23:14
from __future__ import unicode_literals

from django.db import migrations


def populate_default(apps, schema_editor):
    ScriptParameter = apps.get_model('wooey', 'ScriptParameter')
    for obj in ScriptParameter.objects.all():
        obj.default = obj._default
        obj.save()


class Migration(migrations.Migration):

    dependencies = [
        ('wooey', '0036_add-jsonfield'),
    ]

    operations = [
        migrations.RunPython(populate_default)
    ]

# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-04 23:14
from __future__ import unicode_literals
import json

from django.db import migrations


def populate_default(apps, schema_editor):
    ScriptParameter = apps.get_model('wooey', 'ScriptParameter')
    for obj in ScriptParameter.objects.all():
        try:
            obj.default = json.loads(obj._default)
        except Exception:
            obj.default = obj._default
        obj.save()


class Migration(migrations.Migration):

    dependencies = [
        ('wooey', '0036_add-jsonfield'),
    ]

    operations = [
        migrations.RunPython(populate_default)
    ]

Convert iniital json field if possible in migration
Convert iniital json field if possible in migration
