2016-07-21 23:19:50 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from django.db import migrations, models
|
|
|
|
import accounting.models
|
2016-08-10 11:52:57 +00:00
|
|
|
from django.conf import settings
|
2016-07-21 23:19:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Basket',
|
|
|
|
fields=[
|
2016-08-24 20:09:23 +00:00
|
|
|
('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)),
|
2016-08-10 11:52:57 +00:00
|
|
|
('date', models.DateTimeField(verbose_name='date', auto_now=True)),
|
2016-08-24 20:09:23 +00:00
|
|
|
('user', models.ForeignKey(verbose_name='user', to=settings.AUTH_USER_MODEL, related_name='baskets')),
|
2016-07-21 23:19:50 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='BasketItem',
|
|
|
|
fields=[
|
2016-08-24 20:09:23 +00:00
|
|
|
('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)),
|
2016-08-10 11:52:57 +00:00
|
|
|
('product_id', models.IntegerField(verbose_name='product id')),
|
2016-08-24 20:09:23 +00:00
|
|
|
('product_name', models.CharField(max_length=255, verbose_name='product name')),
|
|
|
|
('type_id', models.IntegerField(verbose_name='product type id')),
|
|
|
|
('product_unit_price', accounting.models.CurrencyField(decimal_places=2, max_digits=12, verbose_name='unit price')),
|
2016-07-21 23:19:50 +00:00
|
|
|
('quantity', models.IntegerField(verbose_name='quantity')),
|
2016-08-24 20:09:23 +00:00
|
|
|
('basket', models.ForeignKey(verbose_name='basket', to='eboutic.Basket', related_name='items')),
|
2016-07-21 23:19:50 +00:00
|
|
|
],
|
|
|
|
options={
|
|
|
|
'abstract': False,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Invoice',
|
|
|
|
fields=[
|
2016-08-24 20:09:23 +00:00
|
|
|
('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)),
|
2016-08-10 11:52:57 +00:00
|
|
|
('date', models.DateTimeField(verbose_name='date', auto_now=True)),
|
2016-08-24 20:09:23 +00:00
|
|
|
('validated', models.BooleanField(verbose_name='validated', default=False)),
|
|
|
|
('user', models.ForeignKey(verbose_name='user', to=settings.AUTH_USER_MODEL, related_name='invoices')),
|
2016-07-21 23:19:50 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='InvoiceItem',
|
|
|
|
fields=[
|
2016-08-24 20:09:23 +00:00
|
|
|
('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)),
|
2016-08-10 11:52:57 +00:00
|
|
|
('product_id', models.IntegerField(verbose_name='product id')),
|
2016-08-24 20:09:23 +00:00
|
|
|
('product_name', models.CharField(max_length=255, verbose_name='product name')),
|
|
|
|
('type_id', models.IntegerField(verbose_name='product type id')),
|
|
|
|
('product_unit_price', accounting.models.CurrencyField(decimal_places=2, max_digits=12, verbose_name='unit price')),
|
2016-07-21 23:19:50 +00:00
|
|
|
('quantity', models.IntegerField(verbose_name='quantity')),
|
2016-08-24 20:09:23 +00:00
|
|
|
('invoice', models.ForeignKey(verbose_name='invoice', to='eboutic.Invoice', related_name='items')),
|
2016-07-21 23:19:50 +00:00
|
|
|
],
|
|
|
|
options={
|
|
|
|
'abstract': False,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
]
|