# Generated by Django 3.0.1 on 2019-12-30 18:13

from datetime import datetime
from django.db import migrations


def create_packages_statistic(apps, schema_editor):
    Package = apps.get_model('post', 'Package')
    for i in range(1000, 2000):
        p = Package(
            id=i,
            sender_name=f"Khokhlova {i}",
            receiver_name=f"Magic {i}",
            tracking_number=f"{i}",
            address_from="R'lyeh",
            address_to="Providence, Rhode Island, U.S.",
            price=42,
            value=42,
            weight=42,
            accepted_at=datetime.now(),
            delivered_at=None,
        )
        p.save()

        if not i % 19:
            p.status = 'DV'
        elif not i % 9:
            p.status = 'RJ'
        elif not i % 2:
            p.status = 'TR'

        p.save()


def delete_packages_statistic(apps, schema_editor):
    Package = apps.get_model('post', 'Package')

    for i in range(1000, 2000):
        Package.objects.filter(id=i).delete()


class Migration(migrations.Migration):

    dependencies = [
        ('post', '0003_auto_20191225_2019'),
    ]

    operations = [
        migrations.RunPython(create_packages_statistic, delete_packages_statistic)
    ]

23f0ee3e9d6f7964bd6e645869629ee062fe6c16
<mask token>


class Migration(migrations.Migration):
    dependencies = [('post', '0003_auto_20191225_2019')]
    operations = [migrations.RunPython(create_packages_statistic,
        delete_packages_statistic)]

<mask token>


def delete_packages_statistic(apps, schema_editor):
    Package = apps.get_model('post', 'Package')
    for i in range(1000, 2000):
        Package.objects.filter(id=i).delete()


class Migration(migrations.Migration):
    dependencies = [('post', '0003_auto_20191225_2019')]
    operations = [migrations.RunPython(create_packages_statistic,
        delete_packages_statistic)]

<mask token>


def create_packages_statistic(apps, schema_editor):
    Package = apps.get_model('post', 'Package')
    for i in range(1000, 2000):
        p = Package(id=i, sender_name=f'Khokhlova {i}', receiver_name=
            f'Magic {i}', tracking_number=f'{i}', address_from="R'lyeh",
            address_to='Providence, Rhode Island, U.S.', price=42, value=42,
            weight=42, accepted_at=datetime.now(), delivered_at=None)
        p.save()
        if not i % 19:
            p.status = 'DV'
        elif not i % 9:
            p.status = 'RJ'
        elif not i % 2:
            p.status = 'TR'
        p.save()


def delete_packages_statistic(apps, schema_editor):
    Package = apps.get_model('post', 'Package')
    for i in range(1000, 2000):
        Package.objects.filter(id=i).delete()


class Migration(migrations.Migration):
    dependencies = [('post', '0003_auto_20191225_2019')]
    operations = [migrations.RunPython(create_packages_statistic,
        delete_packages_statistic)]

from datetime import datetime
from django.db import migrations


def create_packages_statistic(apps, schema_editor):
    Package = apps.get_model('post', 'Package')
    for i in range(1000, 2000):
        p = Package(id=i, sender_name=f'Khokhlova {i}', receiver_name=
            f'Magic {i}', tracking_number=f'{i}', address_from="R'lyeh",
            address_to='Providence, Rhode Island, U.S.', price=42, value=42,
            weight=42, accepted_at=datetime.now(), delivered_at=None)
        p.save()
        if not i % 19:
            p.status = 'DV'
        elif not i % 9:
            p.status = 'RJ'
        elif not i % 2:
            p.status = 'TR'
        p.save()


def delete_packages_statistic(apps, schema_editor):
    Package = apps.get_model('post', 'Package')
    for i in range(1000, 2000):
        Package.objects.filter(id=i).delete()


class Migration(migrations.Migration):
    dependencies = [('post', '0003_auto_20191225_2019')]
    operations = [migrations.RunPython(create_packages_statistic,
        delete_packages_statistic)]

# Generated by Django 3.0.1 on 2019-12-30 18:13

from datetime import datetime
from django.db import migrations


def create_packages_statistic(apps, schema_editor):
    Package = apps.get_model('post', 'Package')
    for i in range(1000, 2000):
        p = Package(
            id=i,
            sender_name=f"Khokhlova {i}",
            receiver_name=f"Magic {i}",
            tracking_number=f"{i}",
            address_from="R'lyeh",
            address_to="Providence, Rhode Island, U.S.",
            price=42,
            value=42,
            weight=42,
            accepted_at=datetime.now(),
            delivered_at=None,
        )
        p.save()

        if not i % 19:
            p.status = 'DV'
        elif not i % 9:
            p.status = 'RJ'
        elif not i % 2:
            p.status = 'TR'

        p.save()


def delete_packages_statistic(apps, schema_editor):
    Package = apps.get_model('post', 'Package')

    for i in range(1000, 2000):
        Package.objects.filter(id=i).delete()


class Migration(migrations.Migration):

    dependencies = [
        ('post', '0003_auto_20191225_2019'),
    ]

    operations = [
        migrations.RunPython(create_packages_statistic, delete_packages_statistic)
    ]
