From 11514202779ef96cfbc31c4c61558f56dc903711 Mon Sep 17 00:00:00 2001 From: Prince Kumar Date: Fri, 4 Oct 2024 16:33:46 +0530 Subject: [PATCH] Update migrations --- api/migrations/__init__.py | 0 home/migrations/0001_initial.py | 362 ++++-------------- ...emove_allocationautumn22_month_and_more.py | 125 ------ .../0003_allocationform_show_allocated.py | 17 - .../0004_allocation_registration_time.py | 19 - ...0005_alter_allocation_registration_time.py | 25 -- qrscan/migrations/0001_initial.py | 24 +- qrscan/migrations/0002_messcard_secret_key.py | 18 - .../0003_alter_messcard_secret_key.py | 19 - .../migrations/0004_alter_messcard_qr_code.py | 18 - qrscan/migrations/0005_messcard_student.py | 20 - .../0006_alter_messcard_secret_key.py | 19 - qrscan/migrations/0007_meal.py | 25 -- qrscan/migrations/0008_alter_messcard_id.py | 19 - .../0009_remove_messcard_secret_key.py | 17 - qrscan/migrations/0010_alter_messcard_id.py | 18 - qrscan/migrations/0011_alter_messcard_id.py | 19 - 17 files changed, 103 insertions(+), 661 deletions(-) delete mode 100644 api/migrations/__init__.py delete mode 100644 home/migrations/0002_remove_allocationautumn22_month_and_more.py delete mode 100644 home/migrations/0003_allocationform_show_allocated.py delete mode 100644 home/migrations/0004_allocation_registration_time.py delete mode 100644 home/migrations/0005_alter_allocation_registration_time.py delete mode 100644 qrscan/migrations/0002_messcard_secret_key.py delete mode 100644 qrscan/migrations/0003_alter_messcard_secret_key.py delete mode 100644 qrscan/migrations/0004_alter_messcard_qr_code.py delete mode 100644 qrscan/migrations/0005_messcard_student.py delete mode 100644 qrscan/migrations/0006_alter_messcard_secret_key.py delete mode 100644 qrscan/migrations/0007_meal.py delete mode 100644 qrscan/migrations/0008_alter_messcard_id.py delete mode 100644 qrscan/migrations/0009_remove_messcard_secret_key.py delete mode 100644 qrscan/migrations/0010_alter_messcard_id.py delete mode 100644 qrscan/migrations/0011_alter_messcard_id.py diff --git a/api/migrations/__init__.py b/api/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/home/migrations/0001_initial.py b/home/migrations/0001_initial.py index d98fffa..eb701cb 100644 --- a/home/migrations/0001_initial.py +++ b/home/migrations/0001_initial.py @@ -1,8 +1,8 @@ -# Generated by Django 4.1.7 on 2024-01-24 17:20 +# Generated by Django 5.0.8 on 2024-10-04 11:03 -from django.db import migrations, models import django.db.models.deletion import django.utils.timezone +from django.db import migrations, models class Migration(migrations.Migration): @@ -24,38 +24,6 @@ class Migration(migrations.Migration): 'verbose_name_plural': 'About Us', }, ), - migrations.CreateModel( - name='Allocation', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('student_id', models.CharField(blank=True, default=None, help_text='This contains the Allocation Id', max_length=30, null=True, verbose_name='Allocation Id')), - ('high_tea', models.BooleanField(blank=True, default=False, help_text='This contains the info if high tea is taken or not', null=True, verbose_name='High Tea')), - ('jain', models.BooleanField(blank=True, default=False, help_text='This contains the info if jain food is taken or not', null=True, verbose_name='Jain')), - ('first_pref', models.CharField(blank=True, default=None, help_text='This contians the first preference caterer of the student', max_length=10, null=True, verbose_name='First Preference')), - ('second_pref', models.CharField(blank=True, default=None, help_text='This contians the first preference caterer of the student', max_length=10, null=True, verbose_name='Second Preference')), - ('third_pref', models.CharField(blank=True, default=None, help_text='This contians the first preference caterer of the student', max_length=10, null=True, verbose_name='Third Preference')), - ], - options={ - 'verbose_name': 'Allocation Detail', - 'verbose_name_plural': 'Allocation Details', - }, - ), - migrations.CreateModel( - name='AllocationSpring23', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('student_id', models.CharField(blank=True, default=None, help_text='This contains the Allocation Id', max_length=30, null=True, verbose_name='Allocation Id')), - ('caterer_name', models.CharField(blank=True, default='', help_text='The text in this text field contains the caterer name.', max_length=50, null=True, verbose_name='Caterer Name')), - ('high_tea', models.BooleanField(blank=True, default=False, help_text='This contains the info if high tea is taken or not', null=True, verbose_name='High Tea')), - ('first_pref', models.CharField(blank=True, default=None, help_text='This contians the first preference caterer of the student', max_length=10, null=True, verbose_name='First Preference')), - ('second_pref', models.CharField(blank=True, default=None, help_text='This contians the first preference caterer of the student', max_length=10, null=True, verbose_name='Second Preference')), - ('third_pref', models.CharField(blank=True, default=None, help_text='This contians the first preference caterer of the student', max_length=10, null=True, verbose_name='Third Preference')), - ], - options={ - 'verbose_name': 'Allocation Details for Spring 2023', - 'verbose_name_plural': 'Allocation Details for Spring 2023', - }, - ), migrations.CreateModel( name='Cafeteria', fields=[ @@ -179,49 +147,10 @@ class Migration(migrations.Migration): 'verbose_name_plural': 'Period Details', }, ), - migrations.CreateModel( - name='PeriodAutumn22', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('Sno', models.IntegerField(default=0, help_text='This contains the serial number of the Period', verbose_name='Sno')), - ('start_date', models.DateField(blank=True, help_text='This contains the start date of this Period for this semester', null=True)), - ('end_date', models.DateField(blank=True, help_text='This contains the end date of this Period of this semester', null=True)), - ], - options={ - 'verbose_name': 'Period Details for Autumn 2022', - 'verbose_name_plural': 'Period Details for Autumn 2022', - }, - ), - migrations.CreateModel( - name='PeriodAutumn23', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('Sno', models.IntegerField(default=0, help_text='This contains the serial number of the Period', verbose_name='Sno')), - ('start_date', models.DateField(blank=True, help_text='This contains the start date of this Period for this semester', null=True)), - ('end_date', models.DateField(blank=True, help_text='This contains the end date of this Period of this semester', null=True)), - ], - options={ - 'verbose_name': 'Period Details for Autumn 2023', - 'verbose_name_plural': 'Period Details for Autumn 2023', - }, - ), - migrations.CreateModel( - name='PeriodSpring23', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('Sno', models.IntegerField(default=0, help_text='This contains the serial number of the Period', verbose_name='Sno')), - ('start_date', models.DateField(blank=True, help_text='This contains the start date of this Period for this semester', null=True)), - ('end_date', models.DateField(blank=True, help_text='This contains the end date of this Period of this semester', null=True)), - ], - options={ - 'verbose_name': 'Period Details for Spring 2023', - 'verbose_name_plural': 'Period Details for Spring 2023', - }, - ), migrations.CreateModel( name='Rule', fields=[ - ('sno', models.AutoField(default=1, primary_key=True, serialize=False)), + ('sno', models.AutoField(primary_key=True, serialize=False)), ('rule', models.TextField(help_text='The text in the text field contains the rule that will show as one of the rules of the rule page.', verbose_name='Rule')), ], options={ @@ -277,66 +206,63 @@ class Migration(migrations.Migration): }, ), migrations.CreateModel( - name='UnregisteredStudent', + name='AllocationForm', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('email', models.CharField(default='', max_length=30, verbose_name='email')), + ('heading', models.CharField(blank=True, default='', max_length=100, null=True, verbose_name='heading')), + ('description', models.TextField(blank=True, default='', null=True, verbose_name='description')), + ('active', models.BooleanField(blank=True, default=False, null=True, verbose_name='active')), + ('start_time', models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True, verbose_name='Start Time')), + ('end_time', models.DateTimeField(blank=True, null=True, verbose_name='End Time')), + ('show_allocated', models.BooleanField(default=False, verbose_name='show_allocated')), ('period', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.period')), ], options={ - 'verbose_name': 'Unregistered Students', - 'verbose_name_plural': 'Unregistered Students', + 'verbose_name': 'Allocation Form', + 'verbose_name_plural': 'Allocation Form', }, ), migrations.CreateModel( - name='TodayRebate', + name='Allocation', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date', models.DateField(default=django.utils.timezone.now, help_text='Date of the rebate')), - ('Caterer', models.CharField(default='', max_length=30)), - ('start_date', models.DateField(blank=True, help_text='start date of the rebate', null=True)), - ('end_date', models.DateField(blank=True, help_text='end date of the rebate', null=True)), - ('allocation_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.allocation')), + ('student_id', models.CharField(blank=True, default=None, help_text='This contains the Allocation Id', max_length=30, null=True, verbose_name='Allocation Id')), + ('high_tea', models.BooleanField(blank=True, default=False, help_text='This contains the info if high tea is taken or not', null=True, verbose_name='High Tea')), + ('jain', models.BooleanField(blank=True, default=False, help_text='This contains the info if jain food is taken or not', null=True, verbose_name='Jain')), + ('first_pref', models.CharField(blank=True, default=None, help_text='This contians the first preference caterer of the student', max_length=10, null=True, verbose_name='First Preference')), + ('second_pref', models.CharField(blank=True, default=None, help_text='This contians the first preference caterer of the student', max_length=10, null=True, verbose_name='Second Preference')), + ('third_pref', models.CharField(blank=True, default=None, help_text='This contians the first preference caterer of the student', max_length=10, null=True, verbose_name='Third Preference')), + ('registration_time', models.DateTimeField(blank=True, default=django.utils.timezone.now, help_text='This contains the date and time of registration', null=True, verbose_name='Registration time')), + ('caterer', models.ForeignKey(default=None, help_text='Contains the allocated caterer of the student', null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.caterer')), + ('period', models.ForeignKey(default=None, help_text='Contains the period of allocation', null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.period')), + ('email', models.ForeignKey(default=0, null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.student')), ], options={ - 'verbose_name': "Today's Rebate", - 'verbose_name_plural': "Today's Rebate", + 'verbose_name': 'Allocation Detail', + 'verbose_name_plural': 'Allocation Details', }, ), + migrations.AddField( + model_name='period', + name='semester', + field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='home.semester', verbose_name='Semester'), + ), migrations.CreateModel( - name='StudentBills', + name='CatererBills', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('period1_short', models.IntegerField(default=0, null=True, verbose_name='Period 1 Short')), - ('period1_long', models.IntegerField(default=0, null=True, verbose_name='Period 1 Long')), - ('period1_high_tea', models.BooleanField(default=True, null=True, verbose_name='Period 1 High Tea')), - ('period1_bill', models.IntegerField(default=0, null=True, verbose_name='Period 1 Rebate Amount')), - ('period2_short', models.IntegerField(default=0, null=True, verbose_name='Period 2 Short')), - ('period2_long', models.IntegerField(default=0, null=True, verbose_name='Period 2 Long')), - ('period2_high_tea', models.BooleanField(default=True, null=True, verbose_name='Period 2 High Tea')), - ('period2_bill', models.IntegerField(default=0, null=True, verbose_name='Period 2 Rebate Amount')), - ('period3_short', models.IntegerField(default=0, null=True, verbose_name='Period 3 Short')), - ('period3_long', models.IntegerField(default=0, null=True, verbose_name='Period 3 Long')), - ('period3_high_tea', models.BooleanField(default=True, null=True, verbose_name='Period 3 High Tea')), - ('period3_bill', models.IntegerField(default=0, null=True, verbose_name='Period 3 Rebate Amount')), - ('period4_short', models.IntegerField(default=0, null=True, verbose_name='Period 4 Short')), - ('period4_long', models.IntegerField(default=0, null=True, verbose_name='Period 4 Long')), - ('period4_high_tea', models.BooleanField(default=True, null=True, verbose_name='Period 4 High Tea')), - ('period4_bill', models.IntegerField(default=0, null=True, verbose_name='Period 4 Rebate Amount')), - ('period5_short', models.IntegerField(default=0, null=True, verbose_name='Period 5 Short')), - ('period5_long', models.IntegerField(default=0, null=True, verbose_name='Period 5 Long')), - ('period5_high_tea', models.BooleanField(default=True, null=True, verbose_name='Period 5 High Tea')), - ('period5_bill', models.IntegerField(default=0, null=True, verbose_name='Period 5 Rebate Amount')), - ('period6_short', models.IntegerField(default=0, null=True, verbose_name='Period 6 Short')), - ('period6_long', models.IntegerField(default=0, null=True, verbose_name='Period 6 Long')), - ('period6_high_tea', models.BooleanField(default=True, null=True, verbose_name='Period 6 High Tea')), - ('period6_bill', models.IntegerField(default=0, null=True, verbose_name='Period 6 Rebate Amount')), - ('email', models.ForeignKey(default='', null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.student')), + ('period1_bills', models.IntegerField(default=0, null=True, verbose_name='Period 1 Bill')), + ('period2_bills', models.IntegerField(default=0, null=True, verbose_name='Period 2 Bill')), + ('period3_bills', models.IntegerField(default=0, null=True, verbose_name='Period 3 Bill')), + ('period4_bills', models.IntegerField(default=0, null=True, verbose_name='Period 4 Bill')), + ('period5_bills', models.IntegerField(default=0, null=True, verbose_name='Period 5 Bill')), + ('period6_bills', models.IntegerField(default=0, null=True, verbose_name='Period 6 Bill')), + ('caterer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.caterer')), ('semester', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='home.semester', verbose_name='Semester')), ], options={ - 'verbose_name': 'Rebate Bill', - 'verbose_name_plural': 'Rebate Bills', + 'verbose_name': 'Caterer Bill', + 'verbose_name_plural': 'Caterer Bills', }, ), migrations.CreateModel( @@ -348,7 +274,7 @@ class Migration(migrations.Migration): ('lunch', models.BooleanField(help_text='This contains if the lunch was eaten by the student', verbose_name='lunch')), ('high_tea', models.BooleanField(help_text='This contains if the high tea was eaten by the student', verbose_name='high_tea')), ('dinner', models.BooleanField(help_text='This contains if the dinner was eaten by the student', verbose_name='dinner')), - ('student_id', models.ForeignKey(default=0, null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.allocationspring23')), + ('student_id', models.ForeignKey(default=0, null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.student')), ], options={ 'verbose_name': 'Scan Details', @@ -390,41 +316,6 @@ class Migration(migrations.Migration): 'verbose_name_plural': 'Rebate Bills Spring 2023', }, ), - migrations.CreateModel( - name='RebateAutumn23', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('period1_short', models.IntegerField(default=0, null=True, verbose_name='Period 1 Short')), - ('period1_long', models.IntegerField(default=0, null=True, verbose_name='Period 1 Long')), - ('period1_high_tea', models.BooleanField(default=True, verbose_name='Period 1 High Tea')), - ('period1_bill', models.IntegerField(default=0, null=True, verbose_name='Period 1 Rebate Amount')), - ('period2_short', models.IntegerField(default=0, null=True, verbose_name='Period 2 Short')), - ('period2_long', models.IntegerField(default=0, null=True, verbose_name='Period 2 Long')), - ('period2_high_tea', models.BooleanField(default=True, verbose_name='Period 2 High Tea')), - ('period2_bill', models.IntegerField(default=0, null=True, verbose_name='Period 2 Rebate Amount')), - ('period3_short', models.IntegerField(default=0, null=True, verbose_name='Period 3 Short')), - ('period3_long', models.IntegerField(default=0, null=True, verbose_name='Period 3 Long')), - ('period3_high_tea', models.BooleanField(default=True, verbose_name='Period 3 High Tea')), - ('period3_bill', models.IntegerField(default=0, null=True, verbose_name='Period 3 Rebate Amount')), - ('period4_short', models.IntegerField(default=0, null=True, verbose_name='Period 4 Short')), - ('period4_long', models.IntegerField(default=0, null=True, verbose_name='Period 4 Long')), - ('period4_high_tea', models.BooleanField(default=True, verbose_name='Period 4 High Tea')), - ('period4_bill', models.IntegerField(default=0, null=True, verbose_name='Period 4 Rebate Amount')), - ('period5_short', models.IntegerField(default=0, null=True, verbose_name='Period 5 Short')), - ('period5_long', models.IntegerField(default=0, null=True, verbose_name='Period 5 Long')), - ('period5_high_tea', models.BooleanField(default=True, verbose_name='Period 5 High Tea')), - ('period5_bill', models.IntegerField(default=0, null=True, verbose_name='Period 5 Rebate Amount')), - ('period6_short', models.IntegerField(default=0, null=True, verbose_name='Period 6 Short')), - ('period6_long', models.IntegerField(default=0, null=True, verbose_name='Period 6 Long')), - ('period6_high_tea', models.BooleanField(default=True, verbose_name='Period 6 High Tea')), - ('period6_bill', models.IntegerField(default=0, null=True, verbose_name='Period 6 Rebate Amount')), - ('email', models.ForeignKey(default='', null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.student')), - ], - options={ - 'verbose_name': 'Rebate Bill Autumn 2023', - 'verbose_name_plural': 'Rebate Bills Autumn 2023', - }, - ), migrations.CreateModel( name='RebateAutumn22', fields=[ @@ -476,11 +367,6 @@ class Migration(migrations.Migration): 'verbose_name_plural': 'Short Rebate Details', }, ), - migrations.AddField( - model_name='period', - name='semester', - field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='home.semester', verbose_name='Semester'), - ), migrations.CreateModel( name='LongRebate', fields=[ @@ -489,6 +375,7 @@ class Migration(migrations.Migration): ('end_date', models.DateField(blank=True, help_text='end date of the rebate', null=True)), ('days', models.IntegerField(default=0, verbose_name='days')), ('approved', models.BooleanField(default=False, verbose_name='Approved')), + ('reason', models.TextField(blank=True, choices=[('', 'Choose the reason'), ('Incomplete form. Please submit a new rebate application', 'Incomplete form'), ('Signature of approving authority missing. Please submit a new rebate application', 'Signature missing'), ('Attached file is not the rebate form. Please submit a new rebate application with correct attachment', 'Wrong attached document'), ('There is a date mismatch between the one written in the form and the one in the attached form. Please submit a new rebate application', 'There is a date mismatch between the one written in the form and the one in the attached form')], default='')), ('date_applied', models.DateField(default=django.utils.timezone.now, help_text='Date on which the rebate was applied')), ('file', models.FileField(blank=True, default=None, null=True, upload_to='documents/', verbose_name='File')), ('email', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.student')), @@ -499,149 +386,66 @@ class Migration(migrations.Migration): }, ), migrations.CreateModel( - name='CatererBillsSpring23', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('period1_bills', models.IntegerField(default=0, null=True, verbose_name='Period 1 Bill')), - ('period2_bills', models.IntegerField(default=0, null=True, verbose_name='Period 2 Bill')), - ('period3_bills', models.IntegerField(default=0, null=True, verbose_name='Period 3 Bill')), - ('period4_bills', models.IntegerField(default=0, null=True, verbose_name='Period 4 Bill')), - ('period5_bills', models.IntegerField(default=0, null=True, verbose_name='Period 5 Bill')), - ('period6_bills', models.IntegerField(default=0, null=True, verbose_name='Period 6 Bill')), - ('caterer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.caterer')), - ], - options={ - 'verbose_name': 'Caterer Bill Spring 2023', - 'verbose_name_plural': 'Caterer Bills Spring 2023', - }, - ), - migrations.CreateModel( - name='CatererBillsAutumn23', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('period1_bills', models.IntegerField(default=0, null=True, verbose_name='Period 1 Bill')), - ('period2_bills', models.IntegerField(default=0, null=True, verbose_name='Period 2 Bill')), - ('period3_bills', models.IntegerField(default=0, null=True, verbose_name='Period 3 Bill')), - ('period4_bills', models.IntegerField(default=0, null=True, verbose_name='Period 4 Bill')), - ('period5_bills', models.IntegerField(default=0, null=True, verbose_name='Period 5 Bill')), - ('period6_bills', models.IntegerField(default=0, null=True, verbose_name='Period 6 Bill')), - ('caterer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.caterer')), - ], - options={ - 'verbose_name': 'Caterer Bill Autumn 2023', - 'verbose_name_plural': 'Caterer Bills Autumn 2023', - }, - ), - migrations.CreateModel( - name='CatererBillsAutumn22', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('period1_bills', models.IntegerField(default=0, null=True, verbose_name='Period 1 Bill')), - ('period2_bills', models.IntegerField(default=0, null=True, verbose_name='Period 2 Bill')), - ('period3_bills', models.IntegerField(default=0, null=True, verbose_name='Period 3 Bill')), - ('period4_bills', models.IntegerField(default=0, null=True, verbose_name='Period 4 Bill')), - ('period5_bills', models.IntegerField(default=0, null=True, verbose_name='Period 5 Bill')), - ('period6_bills', models.IntegerField(default=0, null=True, verbose_name='Period 6 Bill')), - ('caterer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.caterer')), - ], - options={ - 'verbose_name': 'Caterer Bill Autumn 2022', - 'verbose_name_plural': 'Caterer Bills Autumn 2022', - }, - ), - migrations.CreateModel( - name='CatererBills', + name='StudentBills', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('period1_bills', models.IntegerField(default=0, null=True, verbose_name='Period 1 Bill')), - ('period2_bills', models.IntegerField(default=0, null=True, verbose_name='Period 2 Bill')), - ('period3_bills', models.IntegerField(default=0, null=True, verbose_name='Period 3 Bill')), - ('period4_bills', models.IntegerField(default=0, null=True, verbose_name='Period 4 Bill')), - ('period5_bills', models.IntegerField(default=0, null=True, verbose_name='Period 5 Bill')), - ('period6_bills', models.IntegerField(default=0, null=True, verbose_name='Period 6 Bill')), - ('caterer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.caterer')), + ('period1_short', models.IntegerField(default=0, null=True, verbose_name='Period 1 Short')), + ('period1_long', models.IntegerField(default=0, null=True, verbose_name='Period 1 Long')), + ('period1_high_tea', models.BooleanField(default=True, null=True, verbose_name='Period 1 High Tea')), + ('period1_bill', models.IntegerField(default=0, null=True, verbose_name='Period 1 Rebate Amount')), + ('period2_short', models.IntegerField(default=0, null=True, verbose_name='Period 2 Short')), + ('period2_long', models.IntegerField(default=0, null=True, verbose_name='Period 2 Long')), + ('period2_high_tea', models.BooleanField(default=True, null=True, verbose_name='Period 2 High Tea')), + ('period2_bill', models.IntegerField(default=0, null=True, verbose_name='Period 2 Rebate Amount')), + ('period3_short', models.IntegerField(default=0, null=True, verbose_name='Period 3 Short')), + ('period3_long', models.IntegerField(default=0, null=True, verbose_name='Period 3 Long')), + ('period3_high_tea', models.BooleanField(default=True, null=True, verbose_name='Period 3 High Tea')), + ('period3_bill', models.IntegerField(default=0, null=True, verbose_name='Period 3 Rebate Amount')), + ('period4_short', models.IntegerField(default=0, null=True, verbose_name='Period 4 Short')), + ('period4_long', models.IntegerField(default=0, null=True, verbose_name='Period 4 Long')), + ('period4_high_tea', models.BooleanField(default=True, null=True, verbose_name='Period 4 High Tea')), + ('period4_bill', models.IntegerField(default=0, null=True, verbose_name='Period 4 Rebate Amount')), + ('period5_short', models.IntegerField(default=0, null=True, verbose_name='Period 5 Short')), + ('period5_long', models.IntegerField(default=0, null=True, verbose_name='Period 5 Long')), + ('period5_high_tea', models.BooleanField(default=True, null=True, verbose_name='Period 5 High Tea')), + ('period5_bill', models.IntegerField(default=0, null=True, verbose_name='Period 5 Rebate Amount')), + ('period6_short', models.IntegerField(default=0, null=True, verbose_name='Period 6 Short')), + ('period6_long', models.IntegerField(default=0, null=True, verbose_name='Period 6 Long')), + ('period6_high_tea', models.BooleanField(default=True, null=True, verbose_name='Period 6 High Tea')), + ('period6_bill', models.IntegerField(default=0, null=True, verbose_name='Period 6 Rebate Amount')), + ('email', models.ForeignKey(default='', null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.student')), ('semester', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='home.semester', verbose_name='Semester')), ], options={ - 'verbose_name': 'Caterer Bill', - 'verbose_name_plural': 'Caterer Bills', - }, - ), - migrations.AddField( - model_name='allocationspring23', - name='month', - field=models.ForeignKey(default=0, null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.periodspring23'), - ), - migrations.AddField( - model_name='allocationspring23', - name='roll_no', - field=models.ForeignKey(default=0, null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.student'), - ), - migrations.CreateModel( - name='AllocationForm', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('heading', models.CharField(blank=True, default='', max_length=100, null=True, verbose_name='heading')), - ('description', models.TextField(blank=True, default='', null=True, verbose_name='description')), - ('active', models.BooleanField(blank=True, default=False, null=True, verbose_name='active')), - ('start_time', models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True, verbose_name='Start Time')), - ('end_time', models.DateTimeField(blank=True, null=True, verbose_name='End Time')), - ('period', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.period')), - ], - options={ - 'verbose_name': 'Allocation Form', - 'verbose_name_plural': 'Allocation Form', + 'verbose_name': 'Rebate Bill', + 'verbose_name_plural': 'Rebate Bills', }, ), migrations.CreateModel( - name='AllocationAutumn23', + name='TodayRebate', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('student_id', models.CharField(blank=True, default=None, help_text='This contains the Allocation Id', max_length=30, null=True, verbose_name='Allocation Id')), - ('caterer_name', models.CharField(blank=True, default='', help_text='The text in this text field contains the caterer name.', max_length=50, null=True, verbose_name='Caterer Name')), - ('high_tea', models.BooleanField(blank=True, default=False, help_text='This contains the info if high tea is taken or not', null=True, verbose_name='High Tea')), - ('first_pref', models.CharField(blank=True, default=None, help_text='This contians the first preference caterer of the student', max_length=10, null=True, verbose_name='First Preference')), - ('second_pref', models.CharField(blank=True, default=None, help_text='This contians the first preference caterer of the student', max_length=10, null=True, verbose_name='Second Preference')), - ('third_pref', models.CharField(blank=True, default=None, help_text='This contians the first preference caterer of the student', max_length=10, null=True, verbose_name='Third Preference')), - ('month', models.ForeignKey(default=0, null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.periodautumn23')), - ('roll_no', models.ForeignKey(default=0, null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.student')), + ('date', models.DateField(default=django.utils.timezone.now, help_text='Date of the rebate')), + ('Caterer', models.CharField(default='', max_length=30)), + ('start_date', models.DateField(blank=True, help_text='start date of the rebate', null=True)), + ('end_date', models.DateField(blank=True, help_text='end date of the rebate', null=True)), + ('allocation_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.allocation')), ], options={ - 'verbose_name': 'Allocation Details for Autumn 2023', - 'verbose_name_plural': 'Allocation Details for Autumn 2023', + 'verbose_name': "Today's Rebate", + 'verbose_name_plural': "Today's Rebate", }, ), migrations.CreateModel( - name='AllocationAutumn22', + name='UnregisteredStudent', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('student_id', models.CharField(blank=True, default=None, help_text='This contains the Allocation Id', max_length=30, null=True, verbose_name='Allocation Id')), - ('caterer_name', models.CharField(blank=True, default='', help_text='The text in this text field contains the caterer name.', max_length=50, null=True, verbose_name='Caterer Name')), - ('high_tea', models.BooleanField(blank=True, default=False, help_text='This contains the info if high tea is taken or not', null=True, verbose_name='High Tea')), - ('first_pref', models.CharField(blank=True, default=None, help_text='This contians the first preference caterer of the student', max_length=10, null=True, verbose_name='First Preference')), - ('second_pref', models.CharField(blank=True, default=None, help_text='This contians the first preference caterer of the student', max_length=10, null=True, verbose_name='Second Preference')), - ('third_pref', models.CharField(blank=True, default=None, help_text='This contians the first preference caterer of the student', max_length=10, null=True, verbose_name='Third Preference')), - ('month', models.ForeignKey(default=0, null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.periodautumn22')), - ('roll_no', models.ForeignKey(default=0, null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.student')), + ('email', models.CharField(default='', max_length=30, verbose_name='email')), + ('period', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.period')), ], options={ - 'verbose_name': 'Allocation Details for Autumn 2022', - 'verbose_name_plural': 'Allocation Details for Autumn 2022', + 'verbose_name': 'Unregistered Students', + 'verbose_name_plural': 'Unregistered Students', }, ), - migrations.AddField( - model_name='allocation', - name='caterer', - field=models.ForeignKey(default=None, help_text='Contains the allocated caterer of the student', null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.caterer'), - ), - migrations.AddField( - model_name='allocation', - name='email', - field=models.ForeignKey(default=0, null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.student'), - ), - migrations.AddField( - model_name='allocation', - name='period', - field=models.ForeignKey(default=None, help_text='Contains the period of allocation', null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.period'), - ), ] diff --git a/home/migrations/0002_remove_allocationautumn22_month_and_more.py b/home/migrations/0002_remove_allocationautumn22_month_and_more.py deleted file mode 100644 index 93423d9..0000000 --- a/home/migrations/0002_remove_allocationautumn22_month_and_more.py +++ /dev/null @@ -1,125 +0,0 @@ -# Generated by Django 5.0.3 on 2024-08-17 14:53 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("home", "0001_initial"), - ] - - operations = [ - migrations.RemoveField( - model_name="allocationautumn22", - name="month", - ), - migrations.RemoveField( - model_name="allocationautumn22", - name="roll_no", - ), - migrations.RemoveField( - model_name="allocationautumn23", - name="month", - ), - migrations.RemoveField( - model_name="allocationautumn23", - name="roll_no", - ), - migrations.RemoveField( - model_name="allocationspring23", - name="month", - ), - migrations.RemoveField( - model_name="allocationspring23", - name="roll_no", - ), - migrations.AlterField( - model_name="scan", - name="student_id", - field=models.ForeignKey( - default=0, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="home.student", - ), - ), - migrations.RemoveField( - model_name="catererbillsautumn22", - name="caterer", - ), - migrations.RemoveField( - model_name="catererbillsautumn23", - name="caterer", - ), - migrations.RemoveField( - model_name="catererbillsspring23", - name="caterer", - ), - migrations.RemoveField( - model_name="rebateautumn23", - name="email", - ), - migrations.AddField( - model_name="longrebate", - name="reason", - field=models.TextField( - blank=True, - choices=[ - ("", "Choose the reason"), - ( - "Incomplete form. Please submit a new rebate application", - "Incomplete form", - ), - ( - "Signature of approving authority missing. Please submit a new rebate application", - "Signature missing", - ), - ( - "Attached file is not the rebate form. Please submit a new rebate application with correct attachment", - "Wrong attached document", - ), - ( - "There is a date mismatch between the one written in the form and the one in the attached form. Please submit a new rebate application", - "There is a date mismatch between the one written in the form and the one in the attached form", - ), - ], - default="", - ), - ), - migrations.AlterField( - model_name="rule", - name="sno", - field=models.AutoField(primary_key=True, serialize=False), - ), - migrations.DeleteModel( - name="PeriodAutumn22", - ), - migrations.DeleteModel( - name="AllocationAutumn22", - ), - migrations.DeleteModel( - name="PeriodAutumn23", - ), - migrations.DeleteModel( - name="AllocationAutumn23", - ), - migrations.DeleteModel( - name="PeriodSpring23", - ), - migrations.DeleteModel( - name="AllocationSpring23", - ), - migrations.DeleteModel( - name="CatererBillsAutumn22", - ), - migrations.DeleteModel( - name="CatererBillsAutumn23", - ), - migrations.DeleteModel( - name="CatererBillsSpring23", - ), - migrations.DeleteModel( - name="RebateAutumn23", - ), - ] diff --git a/home/migrations/0003_allocationform_show_allocated.py b/home/migrations/0003_allocationform_show_allocated.py deleted file mode 100644 index 1c06dd1..0000000 --- a/home/migrations/0003_allocationform_show_allocated.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 5.0.3 on 2024-08-24 05:37 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("home", "0002_remove_allocationautumn22_month_and_more"), - ] - - operations = [ - migrations.AddField( - model_name="allocationform", - name="show_allocated", - field=models.BooleanField(default=False, verbose_name="show_allocated"), - ), - ] diff --git a/home/migrations/0004_allocation_registration_time.py b/home/migrations/0004_allocation_registration_time.py deleted file mode 100644 index fea5c31..0000000 --- a/home/migrations/0004_allocation_registration_time.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 5.0.8 on 2024-09-03 16:13 - -import django.utils.timezone -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('home', '0003_allocationform_show_allocated'), - ] - - operations = [ - migrations.AddField( - model_name='allocation', - name='registration_time', - field=models.DateTimeField(blank=True, default=django.utils.timezone.now, help_text='This contains the time of registration', null=True, verbose_name='Registration time'), - ), - ] diff --git a/home/migrations/0005_alter_allocation_registration_time.py b/home/migrations/0005_alter_allocation_registration_time.py deleted file mode 100644 index 93f7a04..0000000 --- a/home/migrations/0005_alter_allocation_registration_time.py +++ /dev/null @@ -1,25 +0,0 @@ - -# Generated by Django 5.0.3 on 2024-09-25 14:43 - -import django.utils.timezone -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("home", "0004_allocation_registration_time"), - ] - - operations = [ - migrations.AlterField( - model_name="allocation", - name="registration_time", - field=models.DateTimeField( - blank=True, - default=django.utils.timezone.now, - help_text="This contains the date and time of registration", - null=True, - verbose_name="Registration time", - ), - ), - ] diff --git a/qrscan/migrations/0001_initial.py b/qrscan/migrations/0001_initial.py index c99c2a7..27846bd 100644 --- a/qrscan/migrations/0001_initial.py +++ b/qrscan/migrations/0001_initial.py @@ -1,6 +1,7 @@ -# Generated by Django 5.0.8 on 2024-09-25 08:22 +# Generated by Django 5.0.8 on 2024-10-04 11:03 import django.db.models.deletion +import uuid from django.db import migrations, models @@ -9,16 +10,31 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('home', '0005_alter_allocation_registration_time'), + ('home', '0001_initial'), ] operations = [ migrations.CreateModel( name='MessCard', fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('qr_code', models.ImageField(blank=True, help_text='This contains', null=True, upload_to='qr_codes/')), + ('id', models.UUIDField(default=uuid.uuid4, editable=False, help_text='This contains the unique id of the mess card', primary_key=True, serialize=False, unique=True)), + ('qr_code', models.ImageField(blank=True, help_text='This contains the qr code image', null=True, upload_to='qr_codes/')), ('allocation', models.ForeignKey(blank=True, help_text='This contains the allocation details', null=True, on_delete=django.db.models.deletion.CASCADE, to='home.allocation')), + ('student', models.ForeignKey(blank=True, help_text='This contains the student details', null=True, on_delete=django.db.models.deletion.CASCADE, to='home.student')), + ], + ), + migrations.CreateModel( + name='Meal', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('date', models.DateField(auto_now_add=True, help_text='This contains the date of the meal')), + ('breakfast', models.BooleanField(default=False, help_text='This contains the breakfast status')), + ('lunch', models.BooleanField(default=False, help_text='This contains the lunch status')), + ('dinner', models.BooleanField(default=False, help_text='This contains the dinner status')), + ('mess_card', models.ForeignKey(blank=True, help_text='This contains the mess card details', null=True, on_delete=django.db.models.deletion.CASCADE, to='qrscan.messcard')), ], + options={ + 'unique_together': {('mess_card', 'date')}, + }, ), ] diff --git a/qrscan/migrations/0002_messcard_secret_key.py b/qrscan/migrations/0002_messcard_secret_key.py deleted file mode 100644 index 6b4c1b8..0000000 --- a/qrscan/migrations/0002_messcard_secret_key.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 5.0.8 on 2024-09-25 08:35 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('qrscan', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='messcard', - name='secret_key', - field=models.CharField(blank=True, max_length=64, null=True), - ), - ] diff --git a/qrscan/migrations/0003_alter_messcard_secret_key.py b/qrscan/migrations/0003_alter_messcard_secret_key.py deleted file mode 100644 index a163a50..0000000 --- a/qrscan/migrations/0003_alter_messcard_secret_key.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 5.0.8 on 2024-09-25 08:40 - -import qrscan.models -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('qrscan', '0002_messcard_secret_key'), - ] - - operations = [ - migrations.AlterField( - model_name='messcard', - name='secret_key', - field=models.CharField(blank=True, default=qrscan.models.generate_secret_key, max_length=64, null=True), - ), - ] diff --git a/qrscan/migrations/0004_alter_messcard_qr_code.py b/qrscan/migrations/0004_alter_messcard_qr_code.py deleted file mode 100644 index e861c20..0000000 --- a/qrscan/migrations/0004_alter_messcard_qr_code.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 5.0.8 on 2024-09-25 08:50 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('qrscan', '0003_alter_messcard_secret_key'), - ] - - operations = [ - migrations.AlterField( - model_name='messcard', - name='qr_code', - field=models.ImageField(blank=True, help_text='This contains the qr code image', null=True, upload_to='qr_codes/'), - ), - ] diff --git a/qrscan/migrations/0005_messcard_student.py b/qrscan/migrations/0005_messcard_student.py deleted file mode 100644 index 9ace29a..0000000 --- a/qrscan/migrations/0005_messcard_student.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 5.0.8 on 2024-09-25 16:32 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('home', '0005_alter_allocation_registration_time'), - ('qrscan', '0004_alter_messcard_qr_code'), - ] - - operations = [ - migrations.AddField( - model_name='messcard', - name='student', - field=models.ForeignKey(blank=True, help_text='This contains the student details', null=True, on_delete=django.db.models.deletion.CASCADE, to='home.student'), - ), - ] diff --git a/qrscan/migrations/0006_alter_messcard_secret_key.py b/qrscan/migrations/0006_alter_messcard_secret_key.py deleted file mode 100644 index 03a2fce..0000000 --- a/qrscan/migrations/0006_alter_messcard_secret_key.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 5.0.8 on 2024-09-29 09:31 - -import qrscan.models -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('qrscan', '0005_messcard_student'), - ] - - operations = [ - migrations.AlterField( - model_name='messcard', - name='secret_key', - field=models.CharField(blank=True, default=qrscan.models.generate_secret_key, help_text='This contains the secret key for each student', max_length=64, null=True), - ), - ] diff --git a/qrscan/migrations/0007_meal.py b/qrscan/migrations/0007_meal.py deleted file mode 100644 index 634fb40..0000000 --- a/qrscan/migrations/0007_meal.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 5.0.8 on 2024-09-29 11:01 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('qrscan', '0006_alter_messcard_secret_key'), - ] - - operations = [ - migrations.CreateModel( - name='Meal', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date', models.DateField(auto_now_add=True, help_text='This contains the date of the meal')), - ('breakfast', models.BooleanField(default=False, help_text='This contains the breakfast status')), - ('lunch', models.BooleanField(default=False, help_text='This contains the lunch status')), - ('dinner', models.BooleanField(default=False, help_text='This contains the dinner status')), - ('mess_card', models.ForeignKey(blank=True, help_text='This contains the mess card details', null=True, on_delete=django.db.models.deletion.CASCADE, to='qrscan.messcard')), - ], - ), - ] diff --git a/qrscan/migrations/0008_alter_messcard_id.py b/qrscan/migrations/0008_alter_messcard_id.py deleted file mode 100644 index ff4b9c5..0000000 --- a/qrscan/migrations/0008_alter_messcard_id.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 5.0.8 on 2024-10-03 17:43 - -import uuid -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('qrscan', '0007_meal'), - ] - - operations = [ - migrations.AlterField( - model_name='messcard', - name='id', - field=models.UUIDField(default=uuid.uuid4, editable=False, help_text='This contains the unique id of the mess card', primary_key=True, serialize=False, unique=True), - ), - ] diff --git a/qrscan/migrations/0009_remove_messcard_secret_key.py b/qrscan/migrations/0009_remove_messcard_secret_key.py deleted file mode 100644 index b9d0802..0000000 --- a/qrscan/migrations/0009_remove_messcard_secret_key.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 5.0.8 on 2024-10-03 17:44 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('qrscan', '0008_alter_messcard_id'), - ] - - operations = [ - migrations.RemoveField( - model_name='messcard', - name='secret_key', - ), - ] diff --git a/qrscan/migrations/0010_alter_messcard_id.py b/qrscan/migrations/0010_alter_messcard_id.py deleted file mode 100644 index 945e8f4..0000000 --- a/qrscan/migrations/0010_alter_messcard_id.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 5.0.8 on 2024-10-03 17:47 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('qrscan', '0009_remove_messcard_secret_key'), - ] - - operations = [ - migrations.AlterField( - model_name='messcard', - name='id', - field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), - ), - ] diff --git a/qrscan/migrations/0011_alter_messcard_id.py b/qrscan/migrations/0011_alter_messcard_id.py deleted file mode 100644 index 87a9efc..0000000 --- a/qrscan/migrations/0011_alter_messcard_id.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 5.0.8 on 2024-10-03 17:48 - -import uuid -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('qrscan', '0010_alter_messcard_id'), - ] - - operations = [ - migrations.AlterField( - model_name='messcard', - name='id', - field=models.UUIDField(default=uuid.uuid4, editable=False, help_text='This contains the unique id of the mess card', primary_key=True, serialize=False, unique=True), - ), - ]