# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-09-14 22:51
#
# Goes through and crops all bounding boxes that run off the page
#
##########################################################
from __future__ import unicode_literals

from django.db import migrations

PAGES = [4745, 13639, 12643, 10508, 6560, 6337, 5803]

def do_stuff(apps, schemd_editor) -> None:
    Characters = apps.get_model('calligraphy', 'Character').objects
    for page in PAGES:
        for char in Characters.filter(parent_page=page):
            if char.x1 < 0:
                char.x1 = 0
                char.save()


class Migration(migrations.Migration):

    dependencies = [
        ('calligraphy', '0119_auto_20170912_1431'),
    ]

    operations = [ migrations.RunPython(do_stuff)
    ]
