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 = [
2017-04-25 07:49:05 +00:00
( ' id ' , models . AutoField ( verbose_name = ' ID ' , primary_key = True , serialize = False , auto_created = True ) ) ,
2017-01-07 10:17:06 +00:00
( ' date ' , models . DateTimeField ( verbose_name = ' date ' ) ) ,
( ' name ' , models . CharField ( max_length = 64 , verbose_name = ' name ' ) ) ,
( ' todo ' , models . BooleanField ( verbose_name = ' todo ' ) ) ,
2017-04-25 07:49:05 +00:00
( ' comment ' , models . TextField ( verbose_name = ' comment ' , blank = True , null = True ) ) ,
] ,
) ,
migrations . CreateModel (
name = ' ShoppingListItem ' ,
fields = [
( ' id ' , models . AutoField ( verbose_name = ' ID ' , primary_key = True , serialize = False , auto_created = True ) ) ,
( ' name ' , models . CharField ( max_length = 64 , verbose_name = ' name ' ) ) ,
( ' tobuy_quantity ' , models . IntegerField ( verbose_name = ' quantity to buy ' , help_text = ' quantity to buy during the next shopping session ' , default = 6 ) ) ,
( ' bought_quantity ' , models . IntegerField ( verbose_name = ' quantity bought ' , help_text = ' quantity bought during the last shopping session ' , default = 0 ) ) ,
( ' shopping_lists ' , models . ManyToManyField ( verbose_name = ' shopping lists ' , related_name = ' shopping_items_to_buy ' , to = ' stock.ShoppingList ' ) ) ,
2017-01-07 10:17:06 +00:00
] ,
) ,
2016-10-31 07:19:46 +00:00
migrations . CreateModel (
name = ' Stock ' ,
fields = [
2017-04-25 07:49:05 +00:00
( ' id ' , models . AutoField ( verbose_name = ' ID ' , primary_key = True , serialize = False , auto_created = True ) ) ,
2016-10-31 07:19:46 +00:00
( ' name ' , models . CharField ( max_length = 64 , verbose_name = ' name ' ) ) ,
2017-04-25 07:49:05 +00:00
( ' counter ' , models . OneToOneField ( verbose_name = ' counter ' , related_name = ' stock ' , to = ' counter.Counter ' ) ) ,
2016-10-31 07:19:46 +00:00
] ,
) ,
migrations . CreateModel (
name = ' StockItem ' ,
fields = [
2017-04-25 07:49:05 +00:00
( ' id ' , models . AutoField ( verbose_name = ' ID ' , primary_key = True , serialize = False , auto_created = True ) ) ,
2016-10-31 07:19:46 +00:00
( ' name ' , models . CharField ( max_length = 64 , verbose_name = ' name ' ) ) ,
2017-04-25 07:49:05 +00:00
( ' unit_quantity ' , models . IntegerField ( verbose_name = ' unit quantity ' , help_text = ' number of element in one box ' , default = 0 ) ) ,
( ' effective_quantity ' , models . IntegerField ( verbose_name = ' effective quantity ' , help_text = ' number of box ' , default = 0 ) ) ,
( ' minimal_quantity ' , models . IntegerField ( verbose_name = ' minimal quantity ' , help_text = ' if the effective quantity is less than the minimal, item is added to the shopping list ' , default = 1 ) ) ,
( ' stock_owner ' , models . ForeignKey ( related_name = ' items ' , to = ' stock.Stock ' ) ) ,
( ' type ' , models . ForeignKey ( blank = True , null = True , verbose_name = ' type ' , related_name = ' stock_items ' , on_delete = django . db . models . deletion . SET_NULL , to = ' counter.ProductType ' ) ) ,
2016-10-31 07:19:46 +00:00
] ,
) ,
2017-01-07 10:17:06 +00:00
migrations . AddField (
2017-04-25 07:49:05 +00:00
model_name = ' shoppinglistitem ' ,
name = ' stockitem_owner ' ,
field = models . ForeignKey ( null = True , related_name = ' shopping_item ' , to = ' stock.StockItem ' ) ,
) ,
migrations . AddField (
model_name = ' shoppinglistitem ' ,
name = ' type ' ,
field = models . ForeignKey ( blank = True , null = True , verbose_name = ' type ' , related_name = ' shoppinglist_items ' , on_delete = django . db . models . deletion . SET_NULL , to = ' counter.ProductType ' ) ,
2017-01-07 10:17:06 +00:00
) ,
migrations . AddField (
model_name = ' shoppinglist ' ,
name = ' stock_owner ' ,
2017-04-25 07:49:05 +00:00
field = models . ForeignKey ( null = True , related_name = ' shopping_lists ' , to = ' stock.Stock ' ) ,
2017-01-07 10:17:06 +00:00
) ,
2016-10-31 07:19:46 +00:00
]