diff --git a/www/web/warpapi/migrations/0001_initial.py b/www/web/warpapi/migrations/0001_initial.py index 25f4fc39efbbe3705f0978dd7c99a4c527b9fba9..bfefdf6c35f590bbc1a700ea233204751fd0a8e9 100644 --- a/www/web/warpapi/migrations/0001_initial.py +++ b/www/web/warpapi/migrations/0001_initial.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-10-12 00:34 +# Generated by Django 1.9 on 2017-03-14 22:06 from __future__ import unicode_literals from django.db import migrations, models @@ -18,7 +18,8 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('key', models.CharField(max_length=100)), - ('value', models.CharField(max_length=250)), + ('value', models.CharField(blank=True, max_length=250, null=True)), + ('category', models.CharField(blank=True, max_length=100, null=True)), ], ), ] diff --git a/www/web/warpapi/migrations/0002_information_category.py b/www/web/warpapi/migrations/0002_information_category.py deleted file mode 100644 index 806d34839ee930e8cce78aa2789db12068d58344..0000000000000000000000000000000000000000 --- a/www/web/warpapi/migrations/0002_information_category.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-10-12 00:39 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('warpapi', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='information', - name='category', - field=models.CharField(default='', max_length=100), - preserve_default=False, - ), - ] diff --git a/www/web/warpapi/migrations/0003_auto_20161012_0058.py b/www/web/warpapi/migrations/0003_auto_20161012_0058.py deleted file mode 100644 index f37335454f2d7365fca59eabaff138c3a3e9ce4f..0000000000000000000000000000000000000000 --- a/www/web/warpapi/migrations/0003_auto_20161012_0058.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-10-12 00:58 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('warpapi', '0002_information_category'), - ] - - operations = [ - migrations.AlterField( - model_name='information', - name='category', - field=models.CharField(max_length=100, null=True), - ), - ] diff --git a/www/web/warpapi/migrations/0004_auto_20161012_0058.py b/www/web/warpapi/migrations/0004_auto_20161012_0058.py deleted file mode 100644 index a547c7e46aa1acc5ef5fc577255c7bed766021ba..0000000000000000000000000000000000000000 --- a/www/web/warpapi/migrations/0004_auto_20161012_0058.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-10-12 00:58 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('warpapi', '0003_auto_20161012_0058'), - ] - - operations = [ - migrations.AlterField( - model_name='information', - name='value', - field=models.CharField(max_length=250, null=True), - ), - ] diff --git a/www/web/warpapi/migrations/0005_auto_20161012_0059.py b/www/web/warpapi/migrations/0005_auto_20161012_0059.py deleted file mode 100644 index 633a3bd836011c3349e4d8cb70465ac3edbdf926..0000000000000000000000000000000000000000 --- a/www/web/warpapi/migrations/0005_auto_20161012_0059.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-10-12 00:59 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('warpapi', '0004_auto_20161012_0058'), - ] - - operations = [ - migrations.AlterField( - model_name='information', - name='category', - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name='information', - name='value', - field=models.CharField(blank=True, max_length=250, null=True), - ), - ] diff --git a/www/web/warpauth/migrations/0001_initial.py b/www/web/warpauth/migrations/0001_initial.py new file mode 100644 index 0000000000000000000000000000000000000000..984a334f5aa563d40ec67dea0e5f0ed3aba3c4a2 --- /dev/null +++ b/www/web/warpauth/migrations/0001_initial.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9 on 2017-03-14 21:49 +from __future__ import unicode_literals + +from django.db import migrations, models +import ldapdb.models.fields + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='ActivationToken', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('user', models.CharField(max_length=100)), + ('email', models.CharField(max_length=100)), + ('token', models.CharField(max_length=100)), + ('created', models.DateTimeField(auto_now_add=True)), + ], + ), + migrations.CreateModel( + name='LdapGroup', + fields=[ + ('dn', models.CharField(max_length=200, primary_key=True, serialize=False)), + ('gid', ldapdb.models.fields.IntegerField(db_column='gidNumber', unique=True)), + ('name', ldapdb.models.fields.CharField(db_column='cn', max_length=200, primary_key=True, serialize=False)), + ('members', ldapdb.models.fields.ListField(db_column='uniqueMember')), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='LdapUser', + fields=[ + ('dn', models.CharField(max_length=200, primary_key=True, serialize=False)), + ('uid', ldapdb.models.fields.CharField(db_column='uid', max_length=200, primary_key=True, serialize=False, unique=True)), + ('first_name', ldapdb.models.fields.CharField(db_column='givenName', max_length=200)), + ('last_name', ldapdb.models.fields.CharField(db_column='sn', max_length=200)), + ('email', ldapdb.models.fields.CharField(db_column='mail', max_length=200)), + ('cn', ldapdb.models.fields.CharField(db_column='cn', max_length=200)), + ('card_id', ldapdb.models.fields.CharField(db_column='employeeNumber', max_length=200)), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='PasswordResetToken', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('user', models.CharField(max_length=100)), + ('email', models.CharField(max_length=100)), + ('hash', models.CharField(max_length=100)), + ('created', models.DateTimeField(auto_now_add=True)), + ], + ), + ] diff --git a/www/web/warpauth/migrations/__init__.py b/www/web/warpauth/migrations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/www/web/warpfood/migrations/0001_initial.py b/www/web/warpfood/migrations/0001_initial.py new file mode 100644 index 0000000000000000000000000000000000000000..1058d05dc1975d06b44f52293ad12f19a17ba70d --- /dev/null +++ b/www/web/warpfood/migrations/0001_initial.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9 on 2017-03-14 21:49 +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='FoodCategory', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=250)), + ], + ), + migrations.CreateModel( + name='FoodOrder', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('user', models.CharField(max_length=100, null=True)), + ('article', models.CharField(max_length=100, null=True)), + ('size', models.CharField(max_length=100, null=True)), + ('comment', models.CharField(max_length=100, null=True)), + ('price', models.FloatField()), + ('paid', models.BooleanField(default=False)), + ('product_id', models.IntegerField(default=0)), + ], + ), + migrations.CreateModel( + name='FoodProduct', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=250)), + ('size', models.CharField(max_length=100, null=True)), + ('price', models.FloatField()), + ('last_edited', models.DateTimeField(auto_now=True)), + ('food_category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='warpfood.FoodCategory')), + ], + ), + migrations.CreateModel( + name='FoodService', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=250)), + ('homepage', models.CharField(max_length=250)), + ('phone', models.CharField(max_length=250)), + ], + ), + migrations.CreateModel( + name='FoodSheet', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('date', models.DateTimeField(default=django.utils.timezone.now)), + ('estimated_order_time', models.DateTimeField()), + ('closed', models.BooleanField(default=False)), + ('order_user', models.CharField(max_length=100, null=True)), + ('order_time', models.DateTimeField(null=True)), + ('food_service', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='warpfood.FoodService')), + ], + ), + migrations.AddField( + model_name='foodproduct', + name='food_service', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='warpfood.FoodService'), + ), + migrations.AddField( + model_name='foodorder', + name='sheet', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='warpfood.FoodSheet'), + ), + ] diff --git a/www/web/warpfood/migrations/__init__.py b/www/web/warpfood/migrations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/www/web/warpmain/migrations/0001_initial.py b/www/web/warpmain/migrations/0001_initial.py new file mode 100644 index 0000000000000000000000000000000000000000..7f0b87b02fb1181291d41689e13164bec3cb5bcb --- /dev/null +++ b/www/web/warpmain/migrations/0001_initial.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9 on 2017-03-14 21:48 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='News', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('user', models.CharField(max_length=100, null=True)), + ('title', models.CharField(max_length=100)), + ('message', models.TextField()), + ('created', models.DateTimeField(auto_now_add=True)), + ], + ), + ] diff --git a/www/web/warpmain/migrations/__init__.py b/www/web/warpmain/migrations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/www/web/warppay/migrations/0001_initial.py b/www/web/warppay/migrations/0001_initial.py index b19074f32cef9db73eb1df00ed6031a5cb58e366..ee91f586678e206571d5cef86ba4542d3aa6c0a5 100644 --- a/www/web/warppay/migrations/0001_initial.py +++ b/www/web/warppay/migrations/0001_initial.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2017-03-14 17:27 +# Generated by Django 1.9 on 2017-03-14 21:49 from __future__ import unicode_literals from django.db import migrations, models @@ -35,7 +35,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('uid', models.CharField(max_length=100, unique=True)), - ('card_id', models.CharField(max_length=10, null=True, unique=True)), + ('card_id', models.CharField(max_length=10, null=True)), ('credit', models.FloatField()), ], ), diff --git a/www/web/warppay/migrations/0002_auto_20170314_1732.py b/www/web/warppay/migrations/0002_auto_20170314_1732.py deleted file mode 100644 index d8a88569fa1e77c72942b1626fc2a8658db43678..0000000000000000000000000000000000000000 --- a/www/web/warppay/migrations/0002_auto_20170314_1732.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2017-03-14 17:32 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('warppay', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='usercredit', - name='card_id', - field=models.CharField(default='', max_length=10, unique=True), - preserve_default=False, - ), - ] diff --git a/www/web/warppay/migrations/0002_auto_20170314_2208.py b/www/web/warppay/migrations/0002_auto_20170314_2208.py new file mode 100644 index 0000000000000000000000000000000000000000..7cb425b7ed53a48deb2c8cd762fb3808e0634d94 --- /dev/null +++ b/www/web/warppay/migrations/0002_auto_20170314_2208.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9 on 2017-03-14 22:08 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('warppay', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Transaction', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('date', models.DateTimeField(auto_now_add=True)), + ('price_ek', models.FloatField()), + ('price_vk', models.FloatField()), + ('cash_paid', models.BooleanField(default=False)), + ], + ), + migrations.CreateModel( + name='TransactionLog', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('uid', models.CharField(max_length=100)), + ('transaction', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='warppay.Transaction')), + ], + ), + migrations.RenameField( + model_name='product', + old_name='price', + new_name='price_ek', + ), + migrations.RenameField( + model_name='product', + old_name='count', + new_name='stock_count', + ), + migrations.AddField( + model_name='product', + name='barcode', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='product', + name='price_vk', + field=models.FloatField(default=0.0), + preserve_default=False, + ), + migrations.AddField( + model_name='transaction', + name='product', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='warppay.Product'), + ), + ] diff --git a/www/web/warppay/migrations/0003_auto_20170314_1738.py b/www/web/warppay/migrations/0003_auto_20170314_1738.py deleted file mode 100644 index 5c1cb67eefd6a3f18bab64435a9712c27a925adf..0000000000000000000000000000000000000000 --- a/www/web/warppay/migrations/0003_auto_20170314_1738.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2017-03-14 17:38 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('warppay', '0002_auto_20170314_1732'), - ] - - operations = [ - migrations.AlterField( - model_name='usercredit', - name='card_id', - field=models.CharField(max_length=10, null=True, unique=True), - ), - ] diff --git a/www/web/warppay/migrations/0004_auto_20170314_1739.py b/www/web/warppay/migrations/0004_auto_20170314_1739.py deleted file mode 100644 index 32078142f847ec9db277cdf6e5a2889d542fb980..0000000000000000000000000000000000000000 --- a/www/web/warppay/migrations/0004_auto_20170314_1739.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2017-03-14 17:39 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('warppay', '0003_auto_20170314_1738'), - ] - - operations = [ - migrations.AlterField( - model_name='usercredit', - name='card_id', - field=models.CharField(default='None', max_length=10, null=True, unique=True), - ), - ] diff --git a/www/web/warppay/migrations/0005_auto_20170314_1741.py b/www/web/warppay/migrations/0005_auto_20170314_1741.py deleted file mode 100644 index a95f7140152ccbe8ab79b4b4149bae7b5b23a8c7..0000000000000000000000000000000000000000 --- a/www/web/warppay/migrations/0005_auto_20170314_1741.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2017-03-14 17:41 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('warppay', '0004_auto_20170314_1739'), - ] - - operations = [ - migrations.AlterField( - model_name='usercredit', - name='card_id', - field=models.CharField(max_length=10, null=True, unique=True), - ), - ] diff --git a/www/web/warppay/migrations/0006_auto_20170314_1748.py b/www/web/warppay/migrations/0006_auto_20170314_1748.py deleted file mode 100644 index 592b4652158e707d3017e267b74fb2fd7135e660..0000000000000000000000000000000000000000 --- a/www/web/warppay/migrations/0006_auto_20170314_1748.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2017-03-14 17:48 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('warppay', '0005_auto_20170314_1741'), - ] - - operations = [ - migrations.AlterField( - model_name='usercredit', - name='card_id', - field=models.CharField(max_length=10, null=True), - ), - ] diff --git a/www/web/warppay/models.py b/www/web/warppay/models.py index ece3f3b26b41780e404c64940440414a148dd114..6279417c4df9a53ec0622682720d96bb68013236 100644 --- a/www/web/warppay/models.py +++ b/www/web/warppay/models.py @@ -11,9 +11,11 @@ class ProductCategory(models.Model): class Product(models.Model): name = models.CharField(max_length=100, null=True) - price = models.FloatField() + price_ek = models.FloatField() + price_vk = models.FloatField() category = models.ForeignKey(ProductCategory, on_delete=models.CASCADE, null=True) - count = models.IntegerField() + stock_count = models.IntegerField() + barcode = models.CharField(max_length=100, null=True) def __str__(self): return self.name @@ -24,7 +26,17 @@ class ProductSerializer(serializers.ModelSerializer): model = Product fields = ['id', 'name', 'price', 'category', 'count'] - +class Transaction(models.Model): + date = models.DateTimeField(auto_now_add=True) + product = models.ForeignKey(Product, on_delete=models.CASCADE, null=True) + price_ek = models.FloatField() + price_vk = models.FloatField() + cash_paid = models.BooleanField(default=False) + +class TransactionLog(models.Model): + uid = models.CharField(max_length=100) + transaction = models.ForeignKey(Transaction, on_delete=models.CASCADE, null=True) + class UserCredit(models.Model): uid = models.CharField(max_length=100,unique=True) card_id = models.CharField(max_length=10, null=True) # Unique only with django 1.11 @@ -32,6 +44,7 @@ class UserCredit(models.Model): def __str__(self): return self.uid + class UserCreditSerializer(serializers.ModelSerializer): class Meta: model = UserCredit