From 090fb0ca0fd7c5420ce313e54fdd14ccb183cee5 Mon Sep 17 00:00:00 2001 From: ramGopal <129493911+ramG-reddy@users.noreply.github.com> Date: Mon, 14 Oct 2024 14:29:32 +0530 Subject: [PATCH] fix: Resolved System Check errors (#1630) - fix: Changed one line bugs * Resolved system check errors * Changed some fields in IWD Module * Fixes creation of unwanted migration files - chore: migration files for the previous commit changes --- .../migrations/0002_auto_20241012_1459.py | 23 +++++ .../applications/central_mess/models.py | 2 +- FusionIIIT/applications/globals/models.py | 4 +- .../applications/hostel_management/urls.py | 2 +- .../hr2/migrations/0002_auto_20241012_1459.py | 64 +++++++++++++ FusionIIIT/applications/hr2/models.py | 20 ++--- .../migrations/0002_auto_20241012_1459.py | 89 +++++++++++++++++++ FusionIIIT/applications/iwdModuleV2/models.py | 24 ++--- FusionIIIT/applications/iwdModuleV2/views.py | 6 +- .../migrations/0002_auto_20241012_1459.py | 40 +++++++++ .../migrations/0002_auto_20241012_1459.py | 19 ++++ .../research_procedures/models.py | 2 +- 12 files changed, 265 insertions(+), 30 deletions(-) create mode 100644 FusionIIIT/applications/central_mess/migrations/0002_auto_20241012_1459.py create mode 100644 FusionIIIT/applications/hr2/migrations/0002_auto_20241012_1459.py create mode 100644 FusionIIIT/applications/iwdModuleV2/migrations/0002_auto_20241012_1459.py create mode 100644 FusionIIIT/applications/online_cms/migrations/0002_auto_20241012_1459.py create mode 100644 FusionIIIT/applications/research_procedures/migrations/0002_auto_20241012_1459.py diff --git a/FusionIIIT/applications/central_mess/migrations/0002_auto_20241012_1459.py b/FusionIIIT/applications/central_mess/migrations/0002_auto_20241012_1459.py new file mode 100644 index 000000000..fd5b1d205 --- /dev/null +++ b/FusionIIIT/applications/central_mess/migrations/0002_auto_20241012_1459.py @@ -0,0 +1,23 @@ +# Generated by Django 3.1.5 on 2024-10-12 14:59 + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('central_mess', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='payments', + name='payment_date', + field=models.DateField(default=datetime.date.today), + ), + migrations.AlterUniqueTogether( + name='payments', + unique_together=set(), + ), + ] diff --git a/FusionIIIT/applications/central_mess/models.py b/FusionIIIT/applications/central_mess/models.py index ae96e8f82..3e6030952 100644 --- a/FusionIIIT/applications/central_mess/models.py +++ b/FusionIIIT/applications/central_mess/models.py @@ -154,7 +154,7 @@ class Payments(models.Model): amount_paid = models.IntegerField(default=0) payment_month = models.CharField(max_length=20, default=current_month) payment_year = models.IntegerField(default = current_year) - payment_date = models.DateField(default= datetime.date.today()) + payment_date = models.DateField(default= datetime.date.today) # class Meta: # unique_together = (('student_id', 'payment_date')) diff --git a/FusionIIIT/applications/globals/models.py b/FusionIIIT/applications/globals/models.py index b5d7df426..6a924ceff 100644 --- a/FusionIIIT/applications/globals/models.py +++ b/FusionIIIT/applications/globals/models.py @@ -65,10 +65,10 @@ class Constants: ('academic', 'Academic Designation'), ('administrative', 'Administrative Designation'), ) - USER_STATUS = { + USER_STATUS = ( ("NEW", "NEW"), ("PRESENT", "PRESENT"), - } + ) class Designation(models.Model): diff --git a/FusionIIIT/applications/hostel_management/urls.py b/FusionIIIT/applications/hostel_management/urls.py index 95fcdeeb8..28c1915c2 100644 --- a/FusionIIIT/applications/hostel_management/urls.py +++ b/FusionIIIT/applications/hostel_management/urls.py @@ -12,7 +12,7 @@ path('admin/', admin.site.urls), #Home path('', views.hostel_view, name="hostel_view"), - path('/hello', views.hostel_view, name="hello"), + path('hello', views.hostel_view, name="hello"), #Notice Board path('notice_form/', views.notice_board, name="notice_board"), diff --git a/FusionIIIT/applications/hr2/migrations/0002_auto_20241012_1459.py b/FusionIIIT/applications/hr2/migrations/0002_auto_20241012_1459.py new file mode 100644 index 000000000..be4738fe2 --- /dev/null +++ b/FusionIIIT/applications/hr2/migrations/0002_auto_20241012_1459.py @@ -0,0 +1,64 @@ +# Generated by Django 3.1.5 on 2024-10-12 14:59 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hr2', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='appraisalform', + name='employeeId', + field=models.IntegerField(null=True), + ), + migrations.AlterField( + model_name='cpdaadvanceform', + name='amountRequired', + field=models.IntegerField(null=True), + ), + migrations.AlterField( + model_name='cpdaadvanceform', + name='employeeId', + field=models.IntegerField(null=True), + ), + migrations.AlterField( + model_name='cpdaadvanceform', + name='pfNo', + field=models.IntegerField(null=True), + ), + migrations.AlterField( + model_name='cpdareimbursementform', + name='employeeId', + field=models.IntegerField(null=True), + ), + migrations.AlterField( + model_name='cpdareimbursementform', + name='pfNo', + field=models.IntegerField(), + ), + migrations.AlterField( + model_name='empconfidentialdetails', + name='aadhar_no', + field=models.BigIntegerField(default=0, validators=[django.core.validators.MaxValueValidator(999999999999), django.core.validators.MinValueValidator(99999999999)]), + ), + migrations.AlterField( + model_name='leaveform', + name='employeeId', + field=models.IntegerField(null=True), + ), + migrations.AlterField( + model_name='leaveform', + name='pfNo', + field=models.IntegerField(null=True), + ), + migrations.AlterField( + model_name='ltcform', + name='pfNo', + field=models.IntegerField(), + ), + ] diff --git a/FusionIIIT/applications/hr2/models.py b/FusionIIIT/applications/hr2/models.py index 01ca223c7..e225ca076 100644 --- a/FusionIIIT/applications/hr2/models.py +++ b/FusionIIIT/applications/hr2/models.py @@ -78,7 +78,7 @@ class EmpConfidentialDetails(models.Model): table for employee confidential details """ extra_info = models.OneToOneField(ExtraInfo, on_delete=models.CASCADE) - aadhar_no = models.BigIntegerField(default=0, max_length=12, + aadhar_no = models.BigIntegerField(default=0, validators=[MaxValueValidator(999999999999),MinValueValidator(99999999999)]) maritial_status = models.CharField( @@ -149,7 +149,7 @@ class LTCform(models.Model): employeeId = models.IntegerField() name = models.CharField(max_length=100, null=True) blockYear = models.TextField() # - pfNo = models.IntegerField(max_length=50) + pfNo = models.IntegerField() basicPaySalary = models.IntegerField(null=True) designation = models.CharField(max_length=50) departmentInfo = models.CharField(max_length=50) @@ -181,12 +181,12 @@ class LTCform(models.Model): class CPDAAdvanceform(models.Model): id = models.AutoField(primary_key=True) - employeeId = models.IntegerField(max_length=22, null=True) + employeeId = models.IntegerField(null=True) name = models.CharField(max_length=40,null=True) designation = models.CharField(max_length=40,null=True) - pfNo = models.IntegerField(max_length=30,null=True) + pfNo = models.IntegerField(null=True) purpose = models.TextField(max_length=40, null=True) - amountRequired = models.IntegerField(max_length=30,null=True) + amountRequired = models.IntegerField(null=True) advanceDueAdjustment = models.DecimalField(max_digits=10, decimal_places=2, null=True,blank=True) submissionDate = models.DateField(blank=True, null=True) @@ -202,11 +202,11 @@ class CPDAAdvanceform(models.Model): class LeaveForm(models.Model): id = models.AutoField(primary_key=True) - employeeId = models.IntegerField(max_length=22,null=True) + employeeId = models.IntegerField(null=True) name = models.CharField(max_length=40,null=True) designation = models.CharField(max_length=40,null=True) submissionDate = models.DateField(blank=True, null=True) - pfNo = models.IntegerField(max_length=30,null=True) + pfNo = models.IntegerField(null=True) departmentInfo = models.CharField(max_length=40,null=True) natureOfLeave = models.TextField(max_length=40,null=True) leaveStartDate = models.DateField(blank=True, null=True) @@ -237,7 +237,7 @@ class LeaveBalance(models.Model): class Appraisalform(models.Model): id = models.AutoField(primary_key=True) - employeeId = models.IntegerField(max_length=22,null=True) + employeeId = models.IntegerField(null=True) name = models.CharField(max_length=22) designation = models.CharField(max_length=50) disciplineInfo = models.CharField(max_length=22, null=True) @@ -273,10 +273,10 @@ class Appraisalform(models.Model): class CPDAReimbursementform(models.Model): id = models.AutoField(primary_key=True) - employeeId = models.IntegerField(max_length=22,null=True) + employeeId = models.IntegerField(null=True) name = models.CharField(max_length=50) designation = models.CharField(max_length=50) - pfNo = models.IntegerField(max_length=20) + pfNo = models.IntegerField() advanceTaken = models.IntegerField() purpose = models.TextField() adjustmentSubmitted = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True) diff --git a/FusionIIIT/applications/iwdModuleV2/migrations/0002_auto_20241012_1459.py b/FusionIIIT/applications/iwdModuleV2/migrations/0002_auto_20241012_1459.py new file mode 100644 index 000000000..546d6c629 --- /dev/null +++ b/FusionIIIT/applications/iwdModuleV2/migrations/0002_auto_20241012_1459.py @@ -0,0 +1,89 @@ +# Generated by Django 3.1.5 on 2024-10-12 14:59 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('iwdModuleV2', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='pageonedetails', + name='page_id', + field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects'), + ), + migrations.AddField( + model_name='pagethreedetails', + name='page_id', + field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects'), + ), + migrations.AddField( + model_name='pagetwodetails', + name='page_id', + field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects'), + ), + migrations.AlterField( + model_name='addendum', + name='key', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects'), + ), + migrations.AlterField( + model_name='agreement', + name='key', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects'), + ), + migrations.AlterField( + model_name='corrigendumtable', + name='key', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects'), + ), + migrations.AlterField( + model_name='financialbiddetails', + name='key', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects'), + ), + migrations.AlterField( + model_name='letterofintentdetails', + name='key', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects'), + ), + migrations.AlterField( + model_name='nooftechnicalbidtimes', + name='key', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects'), + ), + migrations.AlterField( + model_name='pageonedetails', + name='id', + field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + migrations.AlterField( + model_name='pagethreedetails', + name='id', + field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + migrations.AlterField( + model_name='pagetwodetails', + name='id', + field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + migrations.AlterField( + model_name='prebiddetails', + name='key', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects'), + ), + migrations.AlterField( + model_name='technicalbiddetails', + name='key', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects'), + ), + migrations.AlterField( + model_name='workorderform', + name='key', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects'), + ), + ] diff --git a/FusionIIIT/applications/iwdModuleV2/models.py b/FusionIIIT/applications/iwdModuleV2/models.py index 9a3337987..9c79aa21c 100644 --- a/FusionIIIT/applications/iwdModuleV2/models.py +++ b/FusionIIIT/applications/iwdModuleV2/models.py @@ -9,7 +9,7 @@ class Projects(models.Model): class PageOneDetails(models.Model): - id = models.ForeignKey(Projects, on_delete=models.CASCADE, primary_key=True) + page_id = models.OneToOneField(Projects, on_delete=models.CASCADE, null=True) aESFile = models.FileField(null=True) dASA = models.DateField(null=True) nitNiqNo = models.IntegerField(null=True) @@ -31,7 +31,7 @@ class AESDetails(models.Model): class PageTwoDetails(models.Model): - id = models.ForeignKey(Projects, on_delete=models.CASCADE, primary_key=True) + page_id = models.OneToOneField(Projects, on_delete=models.CASCADE, null=True) corrigendum = models.FileField(null=True) addendum = models.FileField(null=True) preBidMeetingDetails = models.FileField(null=True) @@ -46,7 +46,7 @@ class PageTwoDetails(models.Model): class CorrigendumTable(models.Model): - key = models.ForeignKey(Projects, on_delete=models.CASCADE, unique=True) + key = models.OneToOneField(Projects, on_delete=models.CASCADE) issueDate = models.DateField() nitNo = models.IntegerField() name = models.CharField(max_length=200) @@ -59,7 +59,7 @@ class CorrigendumTable(models.Model): class Addendum(models.Model): - key = models.ForeignKey(Projects, on_delete=models.CASCADE, unique=True) + key = models.OneToOneField(Projects, on_delete=models.CASCADE) issueDate = models.DateField() nitNiqNo = models.IntegerField() name = models.CharField(max_length=200) @@ -68,7 +68,7 @@ class Addendum(models.Model): class PreBidDetails(models.Model): - key = models.ForeignKey(Projects, on_delete=models.CASCADE, unique=True) + key = models.OneToOneField(Projects, on_delete=models.CASCADE) sNo = models.CharField(max_length=200) nameOfParticipants = models.CharField(max_length=200) issuesRaised = models.CharField(max_length=200) @@ -76,7 +76,7 @@ class PreBidDetails(models.Model): class TechnicalBidDetails(models.Model): - key = models.ForeignKey(Projects, on_delete=models.CASCADE, unique=True) + key = models.OneToOneField(Projects, on_delete=models.CASCADE) sNo = models.CharField(max_length=200) requirements = models.CharField(max_length=200) @@ -88,7 +88,7 @@ class TechnicalBidContractorDetails(models.Model): class FinancialBidDetails(models.Model): - key = models.ForeignKey(Projects, on_delete=models.CASCADE, unique=True) + key = models.OneToOneField(Projects, on_delete=models.CASCADE) sNo = models.CharField(max_length=200) description = models.CharField(max_length=200) @@ -103,7 +103,7 @@ class FinancialContractorDetails(models.Model): class LetterOfIntentDetails(models.Model): - key = models.ForeignKey(Projects, on_delete=models.CASCADE, unique=True) + key = models.OneToOneField(Projects, on_delete=models.CASCADE) nitNiqNo = models.IntegerField() dateOfOpening = models.DateField() agency = models.CharField(max_length=200) @@ -112,7 +112,7 @@ class LetterOfIntentDetails(models.Model): class WorkOrderForm(models.Model): - key = models.ForeignKey(Projects, on_delete=models.CASCADE, unique=True) + key = models.OneToOneField(Projects, on_delete=models.CASCADE) issueDate = models.DateField() nitNiqNo = models.IntegerField() agency = models.CharField(max_length=200) @@ -127,7 +127,7 @@ class WorkOrderForm(models.Model): class Agreement(models.Model): - key = models.ForeignKey(Projects, on_delete=models.CASCADE, unique=True) + key = models.OneToOneField(Projects, on_delete=models.CASCADE) date = models.DateField() agencyName = models.CharField(max_length=200) workName = models.CharField(max_length=200) @@ -143,7 +143,7 @@ class Milestones(models.Model): class PageThreeDetails(models.Model): - id = models.ForeignKey(Projects, on_delete=models.CASCADE, primary_key=True) + page_id = models.OneToOneField(Projects, on_delete=models.CASCADE, null=True) extensionOfTime = models.FileField() actualCostOfBuilding = models.IntegerField() @@ -157,7 +157,7 @@ class ExtensionOfTimeDetails(models.Model): class NoOfTechnicalBidTimes(models.Model): - key = models.ForeignKey(Projects, on_delete=models.CASCADE, unique=True) + key = models.OneToOneField(Projects, on_delete=models.CASCADE) number = models.IntegerField() class Requests(models.Model): diff --git a/FusionIIIT/applications/iwdModuleV2/views.py b/FusionIIIT/applications/iwdModuleV2/views.py index 1f999ebd9..be7042499 100644 --- a/FusionIIIT/applications/iwdModuleV2/views.py +++ b/FusionIIIT/applications/iwdModuleV2/views.py @@ -360,13 +360,13 @@ def page1View(request): if request.POST: request.session['projectId'] = request.POST['id'] projectPageOne = PageOneDetails.objects.get( - id=Projects.objects.get(id=request.session['projectId'])) + id=Projects.objects.get(page_id=request.session['projectId'])) return render(request, 'iwdModuleV2/Page1.html', {'x': projectPageOne}) def page2View(request): projectPageTwo = PageTwoDetails.objects.get( - id=Projects.objects.get(id=request.session['projectId'])) + id=Projects.objects.get(page_id=request.session['projectId'])) return render(request, 'iwdModuleV2/Page2.html', {'x': projectPageTwo}) @@ -445,7 +445,7 @@ def milestoneView(request): def page3View(request): pageThreeDetails = PageThreeDetails.objects.get( - id=Projects.objects.get(id=request.session['projectId'])) + id=Projects.objects.get(page_id=request.session['projectId'])) return render(request, 'iwdModuleV2/Page3.html', {'x': pageThreeDetails}) diff --git a/FusionIIIT/applications/online_cms/migrations/0002_auto_20241012_1459.py b/FusionIIIT/applications/online_cms/migrations/0002_auto_20241012_1459.py new file mode 100644 index 000000000..d689e8177 --- /dev/null +++ b/FusionIIIT/applications/online_cms/migrations/0002_auto_20241012_1459.py @@ -0,0 +1,40 @@ +# Generated by Django 3.1.5 on 2024-10-12 14:59 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('academic_information', '0001_initial'), + ('online_cms', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='attendance', + name='no_of_attendance', + field=models.IntegerField(default=1), + ), + migrations.AlterField( + model_name='attendance', + name='present', + field=models.IntegerField(default=0), + ), + migrations.AlterField( + model_name='gradingscheme', + name='type_of_evaluation', + field=models.CharField(max_length=100), + ), + migrations.CreateModel( + name='StudentEvaluation', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('marks', models.DecimalField(decimal_places=2, max_digits=10, null=True)), + ('total_marks', models.DecimalField(decimal_places=2, default=0, max_digits=10)), + ('evaluation_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='online_cms.gradingscheme')), + ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), + ], + ), + ] diff --git a/FusionIIIT/applications/research_procedures/migrations/0002_auto_20241012_1459.py b/FusionIIIT/applications/research_procedures/migrations/0002_auto_20241012_1459.py new file mode 100644 index 000000000..eebc5845e --- /dev/null +++ b/FusionIIIT/applications/research_procedures/migrations/0002_auto_20241012_1459.py @@ -0,0 +1,19 @@ +# Generated by Django 3.1.5 on 2024-10-12 14:59 + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('research_procedures', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='staff_allocations', + name='start_date', + field=models.DateField(default=datetime.date.today), + ), + ] diff --git a/FusionIIIT/applications/research_procedures/models.py b/FusionIIIT/applications/research_procedures/models.py index a02aad5e3..3a653e374 100644 --- a/FusionIIIT/applications/research_procedures/models.py +++ b/FusionIIIT/applications/research_procedures/models.py @@ -77,7 +77,7 @@ class staff_allocations(models.Model): year=models.IntegerField() stipend=models.IntegerField() staff_type=models.CharField(max_length=100,default="research") - start_date=models.DateField(default=datetime.date.today()) #default=datetime.date.today() + start_date=models.DateField(default=datetime.date.today) end_date=models.DateField(null=True, blank=True) def __str__(self):