# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-24 19:13
from __future__ import unicode_literals

from django.db import migrations

def add_theme(apps, schema_editor):
    SessionTheme = apps.get_model('exams', 'SessionTheme')
    SessionTheme.objects.get_or_create(name="Ocean",
                                       defaults={"primary_background_color": "#FFF",
                                                 "secondary_background_color": "#404E67",
                                                 "tertiary_background_color": "#929EB4",
                                                 "primary_font_color": "#212529",
                                                 "secondary_font_color": "#FFF",
                                                 "tertiary_font_color": "#212529",
                                                 "highlight_background": "yellow",
                                                 "highlight_color": "#FFF",
                                                 "table_active": "#aaa",
                                                 "table_hover": "#d1d1d1"})

def delete_theme(apps, schema_editor):
    SessionTheme = apps.get_model('exams', 'SessionTheme')
    SessionTheme.objects.filter(name="Ocean").delete()

class 
(migrations.Migration):

    dependencies = [
        ('exams', '0082_session_theme'),
    ]

    operations = [
        migrations.RunPython(add_theme,
                             reverse_code=delete_theme)
    ]

Migration