# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-15 13:55
from __future__ import unicode_literals

from django.db import migrations
import csv


def load_from_csv(apps, schema_editor):
    # We can't import the Person model directly as it may be a newer
    # version than this migration expects. We use the historical version.
    filename = 'bills.csv'
    Bills = apps.get_model("bills", "Bills")
    with open(filename, 'r') as f:
        fields = {'fieldnames': ('bill', 'amount', 'due_date')}
        reader = csv.DictReader(f, **fields)
        for row in reader:
            b = Bills(**row)
            b.save()


class Migration(migrations.Migration):

    dependencies = [
        ('bills', '0001_initial'),
    ]

    operations = [
    ]
