# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-23 00:37
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Compra',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cantidad', models.IntegerField()),
                ('fecha', models.DateTimeField(default=django.utils.timezone.now)),
            ],
        ),
        migrations.CreateModel(
            name='Producto',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codigo', models.CharField(max_length=7)),
                ('nombre', models.CharField(max_length=30)),
                ('foto', models.ImageField(upload_to='imagen/')),
                ('marca', models.CharField(choices=[('APP', 'Apple'), ('SO', 'Sony'), ('TO', 'Toshiba'), ('SA', 'Samsung')], default='APP', max_length=2)),
                ('precio', models.DecimalField(decimal_places=2, max_digits=10)),
                ('Existencia', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Usuario',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('dpi', models.CharField(max_length=15)),
                ('nombre', models.CharField(max_length=60)),
                ('productos', models.ManyToManyField(through='ventas.Compra', to='ventas.Producto')),
            ],
        ),
        migrations.AddField(
            model_name='compra',
            name='producto',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ventas.Producto'),
        ),
        migrations.AddField(
            model_name='compra',
            name='usuario',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ventas.Usuario'),
        ),
    ]
