<commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django import VERSION as DJANGO_VERSION
from django.db import migrations


def create_indepth_page(apps, schema_editor):
    Page = apps.get_model("wagtailcore", "Page")
    InDepthListPage = apps.get_model("articles", "InDepthListPage")
    home_page = Page.objects.get(slug="home")
    ContentType = apps.get_model("contenttypes", "ContentType")

    indepth_list_page_content_type, created = ContentType.objects.get_or_create(
        model='indepthlistpage',
        app_label='articles',
        defaults={'name': 'indepthlistpage'} if DJANGO_VERSION < (1, 8) else {}
    )

    print(indepth_list_page_content_type.model)

    # Create indepth page
    indepth_page = InDepthListPage.objects.create(
        title="InDepth",
        slug='indepth',
        content_type=indepth_list_page_content_type,
        path='000100010002',
        depth=3,
        numchild=0,
        url_path='/home/indepth/',
    )

    home_page.numchild += 1
    home_page.save()


class Migration(migrations.Migration):

    dependencies = [
        ('contenttypes', '__latest__'),
        ('articles', '0007_indepthlistpage'),
        ('core', '__latest__'),
    ]

    operations = [
        migrations.RunPython(create_indepth_page),
    ]<commit_msg>Updating dependencies.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django import VERSION as DJANGO_VERSION
from django.db import migrations


def create_indepth_page(apps, schema_editor):
    Page = apps.get_model("wagtailcore", "Page")
    InDepthListPage = apps.get_model("articles", "InDepthListPage")
    home_page = Page.objects.get(slug="home")
    ContentType = apps.get_model("contenttypes", "ContentType")

    indepth_list_page_content_type, created = ContentType.objects.get_or_create(
        model='indepthlistpage',
        app_label='articles',
        defaults={'name': 'indepthlistpage'} if DJANGO_VERSION < (1, 8) else {}
    )

    print(indepth_list_page_content_type.model)

    # Create indepth page
    indepth_page = InDepthListPage.objects.create(
        title="InDepth",
        slug='indepth',
        content_type=indepth_list_page_content_type,
        path='000100010002',
        depth=3,
        numchild=0,
        url_path='/home/indepth/',
    )

    home_page.numchild += 1
    home_page.save()


class Migration(migrations.Migration):

    dependencies = [
        ('contenttypes', '__latest__'),
        ('articles', '0009_auto_20150619_2156'),
        ('core', '__latest__'),
    ]

    operations = [
        migrations.RunPython(create_indepth_page),
    ]
{'fraction_non_alphanumeric': 0.11908339594290007, 'fraction_numerical': 0.021036814425244178, 'mean_word_length': 3.430948419301165, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2359705', 'n_tokens_mistral': 909, 'n_tokens_neox': 860, 'n_words': 141}