2016-10-31 07:19:46 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from django.db import migrations, models
|
2017-01-07 10:17:06 +00:00
|
|
|
import django.db.models.deletion
|
2016-10-31 07:19:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
('counter', '0011_auto_20161004_2039'),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
2017-01-07 10:17:06 +00:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='ShoppingList',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
|
|
|
|
('date', models.DateTimeField(verbose_name='date')),
|
|
|
|
('name', models.CharField(max_length=64, verbose_name='name')),
|
|
|
|
('todo', models.BooleanField(verbose_name='todo')),
|
|
|
|
],
|
|
|
|
),
|
2016-10-31 07:19:46 +00:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='Stock',
|
|
|
|
fields=[
|
2017-01-07 10:17:06 +00:00
|
|
|
('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
|
2016-10-31 07:19:46 +00:00
|
|
|
('name', models.CharField(max_length=64, verbose_name='name')),
|
2017-01-07 10:17:06 +00:00
|
|
|
('counter', models.OneToOneField(to='counter.Counter', verbose_name='counter', related_name='stock')),
|
2016-10-31 07:19:46 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='StockItem',
|
|
|
|
fields=[
|
2017-01-07 10:17:06 +00:00
|
|
|
('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
|
2016-10-31 07:19:46 +00:00
|
|
|
('name', models.CharField(max_length=64, verbose_name='name')),
|
2017-01-07 10:17:06 +00:00
|
|
|
('unit_quantity', models.IntegerField(default=0, help_text='number of element in one box', verbose_name='unit quantity')),
|
|
|
|
('effective_quantity', models.IntegerField(default=0, help_text='number of box', verbose_name='effective quantity')),
|
|
|
|
('stock_owner', models.ForeignKey(to='stock.Stock', related_name='items')),
|
|
|
|
('type', models.ForeignKey(to='counter.ProductType', on_delete=django.db.models.deletion.SET_NULL, null=True, verbose_name='type', blank=True, related_name='stock_items')),
|
2016-10-31 07:19:46 +00:00
|
|
|
],
|
|
|
|
),
|
2017-01-07 10:17:06 +00:00
|
|
|
migrations.AddField(
|
|
|
|
model_name='shoppinglist',
|
|
|
|
name='items_to_buy',
|
|
|
|
field=models.ManyToManyField(to='stock.StockItem', related_name='shopping_lists', verbose_name='items to buy'),
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='shoppinglist',
|
|
|
|
name='stock_owner',
|
|
|
|
field=models.ForeignKey(to='stock.Stock', null=True, related_name='shopping_lists'),
|
|
|
|
),
|
2016-10-31 07:19:46 +00:00
|
|
|
]
|