2016-03-28 12:54:35 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from django.db import migrations, models
|
2016-05-30 10:23:59 +00:00
|
|
|
import accounting.models
|
|
|
|
from django.conf import settings
|
2016-03-28 12:54:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
2016-03-29 10:45:10 +00:00
|
|
|
('club', '0001_initial'),
|
|
|
|
('core', '0001_initial'),
|
2016-03-28 12:54:35 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Counter',
|
|
|
|
fields=[
|
2016-05-30 10:23:59 +00:00
|
|
|
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
|
2016-03-28 12:54:35 +00:00
|
|
|
('name', models.CharField(max_length=30, verbose_name='name')),
|
2016-05-30 10:23:59 +00:00
|
|
|
('type', models.CharField(choices=[('BAR', 'Bar'), ('OFFICE', 'Office')], max_length=255, verbose_name='subscription type')),
|
2016-03-28 12:54:35 +00:00
|
|
|
('club', models.ForeignKey(to='club.Club', related_name='counters')),
|
2016-05-30 10:23:59 +00:00
|
|
|
('edit_groups', models.ManyToManyField(related_name='editable_counters', to='core.Group', blank=True)),
|
2016-03-28 12:54:35 +00:00
|
|
|
],
|
|
|
|
),
|
2016-05-30 10:23:59 +00:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='Customer',
|
|
|
|
fields=[
|
|
|
|
('user', models.OneToOneField(to=settings.AUTH_USER_MODEL, primary_key=True, serialize=False)),
|
|
|
|
('account_id', models.CharField(unique=True, max_length=10, verbose_name='account id')),
|
|
|
|
],
|
|
|
|
options={
|
|
|
|
'verbose_name_plural': 'customers',
|
|
|
|
'verbose_name': 'customer',
|
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Product',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
|
|
|
|
('name', models.CharField(max_length=30, verbose_name='name')),
|
|
|
|
('description', models.TextField(blank=True, verbose_name='description')),
|
|
|
|
('code', models.CharField(max_length=10, verbose_name='code')),
|
|
|
|
('purchase_price', accounting.models.CurrencyField(max_digits=12, decimal_places=2, verbose_name='purchase price')),
|
|
|
|
('selling_price', accounting.models.CurrencyField(max_digits=12, decimal_places=2, verbose_name='selling price')),
|
|
|
|
('special_selling_price', accounting.models.CurrencyField(max_digits=12, decimal_places=2, verbose_name='special selling price')),
|
|
|
|
('icon', models.ImageField(blank=True, upload_to='products', null=True)),
|
|
|
|
('club', models.ForeignKey(to='club.Club', related_name='products')),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='ProductType',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
|
|
|
|
('name', models.CharField(max_length=30, verbose_name='name')),
|
|
|
|
('description', models.TextField(blank=True, verbose_name='description', null=True)),
|
|
|
|
('icon', models.ImageField(blank=True, upload_to='products', null=True)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='product',
|
|
|
|
name='product_type',
|
|
|
|
field=models.ForeignKey(to='counter.ProductType', related_name='products', null=True, blank=True),
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='counter',
|
|
|
|
name='products',
|
|
|
|
field=models.ManyToManyField(related_name='counters', to='counter.Product', blank=True),
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='counter',
|
|
|
|
name='view_groups',
|
|
|
|
field=models.ManyToManyField(related_name='viewable_counters', to='core.Group', blank=True),
|
|
|
|
),
|
2016-03-28 12:54:35 +00:00
|
|
|
]
|