diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 000000000..9e246314b Binary files /dev/null and b/.DS_Store differ diff --git a/.github/.DS_Store b/.github/.DS_Store new file mode 100644 index 000000000..001449329 Binary files /dev/null and b/.github/.DS_Store differ diff --git a/.gitignore b/.gitignore index 497fd7a16..e2bbb7600 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,5 @@ node_modules/ FusionIIIT/static/ package-lock.json + +**/**/migrations/* \ No newline at end of file diff --git a/FusionIIIT/.DS_Store b/FusionIIIT/.DS_Store new file mode 100644 index 000000000..366f1cf64 Binary files /dev/null and b/FusionIIIT/.DS_Store differ diff --git a/FusionIIIT/Fusion/context_processors.py b/FusionIIIT/Fusion/context_processors.py new file mode 100644 index 000000000..54566d56e --- /dev/null +++ b/FusionIIIT/Fusion/context_processors.py @@ -0,0 +1,5 @@ +def global_vars(request): + return { + 'global_var': request.session.get('currentDesignationSelected', 'default_value'), + 'global_var2': request.session.get('allDesignations', 'default_value2'), + } \ No newline at end of file diff --git a/FusionIIIT/Fusion/middleware/custom_middleware.py b/FusionIIIT/Fusion/middleware/custom_middleware.py new file mode 100644 index 000000000..f77873534 --- /dev/null +++ b/FusionIIIT/Fusion/middleware/custom_middleware.py @@ -0,0 +1,48 @@ +# custom_middleware.py +from django.contrib.auth.signals import user_logged_in +from django.dispatch import receiver +from applications.globals.models import (ExtraInfo, Feedback, HoldsDesignation, + Issue, IssueImage, DepartmentInfo) +from django.shortcuts import get_object_or_404, redirect, render + +def user_logged_in_middleware(get_response): + @receiver(user_logged_in) + def user_logged_in_handler(sender, user, request, **kwargs): + if 'function_executed' not in request.session: + # Run the function only if the flag is not set + # Assuming user is a model with the desired data field, retrieve the data + # For example, if your User model has a field named 'custom_field', you can access it like: + if user.is_authenticated: + desig = list(HoldsDesignation.objects.select_related('user','working','designation').all().filter(working = request.user).values_list('designation')) + print(desig) + b = [i for sub in desig for i in sub] + design = HoldsDesignation.objects.select_related('user','designation').filter(working=request.user) + + designation=[] + + designation.append(str(user.extrainfo.user_type)) + for i in design: + if str(i.designation) != str(user.extrainfo.user_type): + print('-------') + print(i.designation) + print(user.extrainfo.user_type) + print('') + designation.append(str(i.designation)) + + for i in designation: + print(i) + + request.session['currentDesignationSelected'] = designation[0] + request.session['allDesignations'] = designation + print("logged iN") + + # Set the flag in the session to indicate that the function has bee+n executed + request.session['function_executed'] = True + + def middleware(request): + if request.user.is_authenticated: + user_logged_in_handler(request.user, request.user, request) + response = get_response(request) + return response + + return middleware \ No newline at end of file diff --git a/FusionIIIT/Fusion/settings/common.py b/FusionIIIT/Fusion/settings/common.py index b98ea6960..fabe81ec2 100644 --- a/FusionIIIT/Fusion/settings/common.py +++ b/FusionIIIT/Fusion/settings/common.py @@ -163,6 +163,7 @@ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'Fusion.middleware.custom_middleware.user_logged_in_middleware', ] ROOT_URLCONF = 'Fusion.urls' @@ -178,6 +179,7 @@ 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', + 'Fusion.context_processors.global_vars', ], }, }, diff --git a/FusionIIIT/applications/.DS_Store b/FusionIIIT/applications/.DS_Store new file mode 100644 index 000000000..9f3de073a Binary files /dev/null and b/FusionIIIT/applications/.DS_Store differ diff --git a/FusionIIIT/applications/academic_information/.DS_Store b/FusionIIIT/applications/academic_information/.DS_Store new file mode 100644 index 000000000..f72d4e850 Binary files /dev/null and b/FusionIIIT/applications/academic_information/.DS_Store differ diff --git a/FusionIIIT/applications/academic_information/migrations/0001_initial.py b/FusionIIIT/applications/academic_information/migrations/0001_initial.py deleted file mode 100644 index f75d3119c..000000000 --- a/FusionIIIT/applications/academic_information/migrations/0001_initial.py +++ /dev/null @@ -1,182 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('programme_curriculum', '0001_initial'), - ('globals', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Calendar', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('from_date', models.DateField()), - ('to_date', models.DateField()), - ('description', models.CharField(max_length=40)), - ], - options={ - 'db_table': 'Calendar', - }, - ), - migrations.CreateModel( - name='Course', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('course_name', models.CharField(max_length=600)), - ('course_details', models.TextField(max_length=500)), - ], - options={ - 'db_table': 'Course', - }, - ), - migrations.CreateModel( - name='Curriculum', - fields=[ - ('curriculum_id', models.AutoField(primary_key=True, serialize=False)), - ('course_code', models.CharField(max_length=20)), - ('credits', models.IntegerField()), - ('course_type', models.CharField(choices=[('Professional Core', 'Professional Core'), ('Professional Elective', 'Professional Elective'), ('Professional Lab', 'Professional Lab'), ('Engineering Science', 'Engineering Science'), ('Natural Science', 'Natural Science'), ('Humanities', 'Humanities'), ('Design', 'Design'), ('Manufacturing', 'Manufacturing'), ('Management Science', 'Management Science')], max_length=25)), - ('programme', models.CharField(choices=[('B.Tech', 'B.Tech'), ('B.Des', 'B.Des'), ('M.Tech', 'M.Tech'), ('M.Des', 'M.Des'), ('PhD', 'PhD')], max_length=10)), - ('branch', models.CharField(choices=[('CSE', 'CSE'), ('ECE', 'ECE'), ('ME', 'ME'), ('DESIGN', 'DESIGN'), ('Common', 'Common')], default='Common', max_length=10)), - ('batch', models.IntegerField()), - ('sem', models.IntegerField()), - ('optional', models.BooleanField(default=False)), - ('floated', models.BooleanField(default=False)), - ('course_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.course')), - ], - options={ - 'db_table': 'Curriculum', - 'unique_together': {('course_code', 'batch', 'programme')}, - }, - ), - migrations.CreateModel( - name='Curriculum_Instructor', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('chief_inst', models.BooleanField(default=False)), - ('curriculum_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.curriculum')), - ('instructor_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - options={ - 'db_table': 'Curriculum_Instructor', - 'unique_together': {('curriculum_id', 'instructor_id')}, - }, - ), - migrations.CreateModel( - name='Exam_timetable', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('upload_date', models.DateField(auto_now_add=True)), - ('exam_time_table', models.FileField(upload_to='Administrator/academic_information/')), - ('batch', models.IntegerField(default='2016')), - ('programme', models.CharField(choices=[('B.Tech', 'B.Tech'), ('B.Des', 'B.Des'), ('M.Tech', 'M.Tech'), ('M.Des', 'M.Des'), ('PhD', 'PhD')], max_length=10)), - ], - options={ - 'db_table': 'Exam_Timetable', - }, - ), - migrations.CreateModel( - name='Holiday', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('holiday_date', models.DateField()), - ('holiday_name', models.CharField(max_length=40)), - ('holiday_type', models.CharField(choices=[('restricted', 'restricted'), ('closed', 'closed'), ('vacation', 'vacation')], default='restricted', max_length=30)), - ], - options={ - 'db_table': 'Holiday', - }, - ), - migrations.CreateModel( - name='Meeting', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('venue', models.CharField(max_length=50)), - ('date', models.DateField()), - ('time', models.CharField(max_length=20)), - ('agenda', models.TextField()), - ('minutes_file', models.CharField(max_length=40)), - ], - options={ - 'db_table': 'Meeting', - }, - ), - migrations.CreateModel( - name='Student', - fields=[ - ('id', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='globals.extrainfo')), - ('programme', models.CharField(choices=[('B.Tech', 'B.Tech'), ('B.Des', 'B.Des'), ('M.Tech', 'M.Tech'), ('M.Des', 'M.Des'), ('PhD', 'PhD')], max_length=10)), - ('batch', models.IntegerField(default=2016)), - ('cpi', models.FloatField(default=0)), - ('category', models.CharField(choices=[('GEN', 'General'), ('SC', 'Scheduled Castes'), ('ST', 'Scheduled Tribes'), ('OBC', 'Other Backward Classes')], max_length=10)), - ('father_name', models.CharField(default='', max_length=40)), - ('mother_name', models.CharField(default='', max_length=40)), - ('hall_no', models.IntegerField(default=0)), - ('room_no', models.CharField(blank=True, max_length=10, null=True)), - ('specialization', models.CharField(choices=[('Power and Control', 'Power and Control'), ('Microwave and Communication Engineering', 'Microwave and Communication Engineering'), ('Micro-nano Electronics', 'Micro-nano Electronics'), ('CAD/CAM', 'CAD/CAM'), ('Design', 'Design'), ('Manufacturing', 'Manufacturing'), ('CSE', 'CSE'), ('Mechatronics', 'Mechatronics'), ('MDes', 'MDes'), ('None', 'None')], default='', max_length=40, null=True)), - ('curr_semester_no', models.IntegerField(default=1)), - ('batch_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.batch')), - ], - ), - migrations.CreateModel( - name='Timetable', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('upload_date', models.DateTimeField(auto_now_add=True)), - ('time_table', models.FileField(upload_to='Administrator/academic_information/')), - ('batch', models.IntegerField(default='2016')), - ('programme', models.CharField(choices=[('B.Tech', 'B.Tech'), ('B.Des', 'B.Des'), ('M.Tech', 'M.Tech'), ('M.Des', 'M.Des'), ('PhD', 'PhD')], max_length=10)), - ('branch', models.CharField(choices=[('CSE', 'CSE'), ('ECE', 'ECE'), ('ME', 'ME'), ('DESIGN', 'DESIGN'), ('Common', 'Common')], default='Common', max_length=10)), - ], - options={ - 'db_table': 'Timetable', - }, - ), - migrations.CreateModel( - name='Student_attendance', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date', models.DateField()), - ('present', models.BooleanField(default=False)), - ('instructor_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.curriculum_instructor')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'Student_attendance', - }, - ), - migrations.CreateModel( - name='Grades', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('grade', models.CharField(max_length=4)), - ('verify', models.BooleanField(default=False)), - ('curriculum_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.curriculum')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'Grades', - }, - ), - migrations.CreateModel( - name='Spi', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('sem', models.IntegerField()), - ('spi', models.FloatField(default=0)), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'Spi', - 'unique_together': {('student_id', 'sem')}, - }, - ), - ] diff --git a/FusionIIIT/applications/academic_procedures/migrations/0001_initial.py b/FusionIIIT/applications/academic_procedures/migrations/0001_initial.py deleted file mode 100644 index b873390df..000000000 --- a/FusionIIIT/applications/academic_procedures/migrations/0001_initial.py +++ /dev/null @@ -1,405 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -import datetime -from django.db import migrations, models -import django.db.models.deletion -import django.utils.timezone - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('academic_information', '0001_initial'), - ('programme_curriculum', '0001_initial'), - ('globals', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Assistantship_status', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('student_status', models.BooleanField()), - ('hod_status', models.BooleanField()), - ('account_status', models.BooleanField()), - ], - ), - migrations.CreateModel( - name='MinimumCredits', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('semester', models.IntegerField()), - ('credits', models.IntegerField()), - ], - ), - migrations.CreateModel( - name='ThesisTopicProcess', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('research_area', models.CharField(max_length=50)), - ('thesis_topic', models.CharField(max_length=1000)), - ('submission_by_student', models.BooleanField(default=False)), - ('pending_supervisor', models.BooleanField(default=True)), - ('approval_supervisor', models.BooleanField(default=False)), - ('forwarded_to_hod', models.BooleanField(default=False)), - ('pending_hod', models.BooleanField(default=True)), - ('approval_by_hod', models.BooleanField(default=False)), - ('date', models.DateField(default=datetime.datetime.now)), - ('co_supervisor_id', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='thesistopicprocess_co_supervisor', to='globals.faculty')), - ('curr_id', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='academic_information.curriculum')), - ('member1', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='thesistopicprocess_member1', to='globals.faculty')), - ('member2', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='thesistopicprocess_member2', to='globals.faculty')), - ('member3', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='thesistopicprocess_member3', to='globals.faculty')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ('supervisor_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='thesistopicprocess_supervisor', to='globals.faculty')), - ], - options={ - 'db_table': 'ThesisTopicProcess', - }, - ), - migrations.CreateModel( - name='Thesis', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('topic', models.CharField(max_length=1000)), - ('reg_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ('supervisor_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.faculty')), - ], - options={ - 'db_table': 'Thesis', - }, - ), - migrations.CreateModel( - name='TeachingCreditRegistration', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('req_pending', models.BooleanField(default=True)), - ('course_completion', models.BooleanField(default=False)), - ('approved_course', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='teachingcreditregistration_approved_course', to='academic_information.curriculum')), - ('curr_1', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='teachingcreditregistration_curr1', to='academic_information.curriculum')), - ('curr_2', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='teachingcreditregistration_curr2', to='academic_information.curriculum')), - ('curr_3', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='teachingcreditregistration_curr3', to='academic_information.curriculum')), - ('curr_4', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='teachingcreditregistration_curr4', to='academic_information.curriculum')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ('supervisor_id', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='teachingcreditregistration_supervisor_id', to='globals.faculty')), - ], - options={ - 'db_table': 'TeachingCreditRegistration', - }, - ), - migrations.CreateModel( - name='StudentRegistrationChecks', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pre_registration_flag', models.BooleanField(default=False)), - ('final_registration_flag', models.BooleanField(default=False)), - ('semester_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.semester')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'StudentRegistrationChecks', - }, - ), - migrations.CreateModel( - name='StudentRegistrationCheck', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pre_registration_flag', models.BooleanField(default=False)), - ('final_registration_flag', models.BooleanField(default=False)), - ('semester', models.IntegerField(default=1)), - ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'StudentRegistrationCheck', - }, - ), - migrations.CreateModel( - name='SemesterMarks', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('q1', models.FloatField(default=None)), - ('mid_term', models.FloatField(default=None)), - ('q2', models.FloatField(default=None)), - ('end_term', models.FloatField(default=None)), - ('other', models.FloatField(default=None)), - ('grade', models.CharField(choices=[('O', 'O'), ('A+', 'A+'), ('A', 'A'), ('B+', 'B+'), ('B', 'B'), ('C+', 'C+'), ('C', 'C'), ('D+', 'D+'), ('D', 'D'), ('F', 'F'), ('S', 'S'), ('X', 'X')], max_length=5, null=True)), - ('curr_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.course')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'SemesterMarks', - }, - ), - migrations.CreateModel( - name='PhDProgressExamination', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('theme', models.CharField(max_length=50)), - ('seminar_date_time', models.DateTimeField()), - ('place', models.CharField(max_length=30)), - ('work_done', models.TextField()), - ('specific_contri_curr_semester', models.TextField()), - ('future_plan', models.TextField()), - ('details', models.FileField(upload_to='academic_procedure/Uploaded_document/PhdProgressDetails/')), - ('papers_published', models.IntegerField()), - ('presented_papers', models.IntegerField()), - ('papers_submitted', models.IntegerField()), - ('quality_of_work', models.CharField(choices=[('Excellent', 'Excellent'), ('Good', 'Good'), ('Satisfactory', 'Satisfactory'), ('Unsatisfactory', 'Unsatisfactory')], max_length=20)), - ('quantity_of_work', models.CharField(choices=[('Enough', 'Enough'), ('Just Sufficient', 'Just Sufficient'), ('Insufficient', 'Insufficient')], max_length=15)), - ('Overall_grade', models.CharField(choices=[('A+', 'A+'), ('A', 'A'), ('B+', 'B+'), ('B', 'B'), ('C+', 'C+'), ('C', 'C'), ('D+', 'D'), ('D', 'D'), ('F', 'F')], max_length=2)), - ('completion_period', models.IntegerField(null=True)), - ('panel_report', models.TextField(null=True)), - ('continuation_enhancement_assistantship', models.CharField(choices=[('yes', 'yes'), ('no', 'no'), ('not applicable', 'not applicable')], max_length=20, null=True)), - ('enhancement_assistantship', models.CharField(choices=[('yes', 'yes'), ('no', 'no'), ('not applicable', 'not applicable')], max_length=15, null=True)), - ('annual_progress_seminar', models.CharField(choices=[('Give again', 'Give again'), ('Not Applicable', 'Not Applicable'), ('Approved', 'Approved')], max_length=20, null=True)), - ('commments', models.TextField(null=True)), - ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='MTechGraduateSeminarReport', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('theme_of_work', models.TextField()), - ('date', models.DateField()), - ('place', models.CharField(max_length=30)), - ('time', models.TimeField()), - ('work_done_till_previous_sem', models.TextField()), - ('specific_contri_in_cur_sem', models.TextField()), - ('future_plan', models.TextField()), - ('brief_report', models.FileField(upload_to='academic_procedure/Uploaded_document/GraduateSeminarReport/')), - ('publication_submitted', models.IntegerField()), - ('publication_accepted', models.IntegerField()), - ('paper_presented', models.IntegerField()), - ('papers_under_review', models.IntegerField()), - ('quality_of_work', models.CharField(choices=[('Excellent', 'Excellent'), ('Good', 'Good'), ('Satisfactory', 'Satisfactory'), ('Unsatisfactory', 'Unsatisfactory')], max_length=20)), - ('quantity_of_work', models.CharField(choices=[('Enough', 'Enough'), ('Just Sufficient', 'Just Sufficient'), ('Insufficient', 'Insufficient')], max_length=15)), - ('Overall_grade', models.CharField(choices=[('A+', 'A+'), ('A', 'A'), ('B+', 'B+'), ('B', 'B'), ('C+', 'C+'), ('C', 'C'), ('D+', 'D'), ('D', 'D'), ('F', 'F')], max_length=2)), - ('panel_report', models.CharField(choices=[('Give again', 'Give again'), ('Not Applicable', 'Not Applicable'), ('Approved', 'Approved')], max_length=15)), - ('suggestion', models.TextField(null=True)), - ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='MessDue', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('month', models.CharField(choices=[('Jan', 'January'), ('Feb', 'Febuary'), ('Mar', 'March'), ('Apr', 'April'), ('May', 'May'), ('Jun', 'June'), ('Jul', 'July'), ('Aug', 'August'), ('Sep', 'September'), ('Oct', 'October'), ('Nov', 'November'), ('Dec', 'December')], max_length=10)), - ('year', models.IntegerField(choices=[(2023, 2023), (2022, 2022)])), - ('description', models.CharField(choices=[('Stu_paid', 'Paid'), ('Stu_due', 'Due')], max_length=15)), - ('amount', models.IntegerField()), - ('remaining_amount', models.IntegerField()), - ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='MarkSubmissionCheck', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('verified', models.BooleanField(default=False)), - ('submitted', models.BooleanField(default=False)), - ('announced', models.BooleanField(default=False)), - ('curr_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.course')), - ], - options={ - 'db_table': 'MarkSubmissionCheck', - }, - ), - migrations.CreateModel( - name='InitialRegistrations', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('timestamp', models.DateTimeField(default=django.utils.timezone.now)), - ('priority', models.IntegerField(blank=True, null=True)), - ('course_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.course')), - ('course_slot_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='programme_curriculum.courseslot')), - ('semester_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.semester')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'InitialRegistrations', - }, - ), - migrations.CreateModel( - name='InitialRegistration', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('timestamp', models.DateTimeField(default=django.utils.timezone.now)), - ('priority', models.IntegerField(blank=True, null=True)), - ('course_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.course')), - ('course_slot_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='programme_curriculum.courseslot')), - ('semester_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.semester')), - ('student_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'InitialRegistration', - }, - ), - migrations.CreateModel( - name='FinalRegistrations', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('semester', models.IntegerField()), - ('batch', models.IntegerField(default=2023)), - ('verified', models.BooleanField(default=False)), - ('curr_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.curriculum')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'FinalRegistrations', - }, - ), - migrations.CreateModel( - name='FinalRegistration', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('verified', models.BooleanField(default=False)), - ('course_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.course')), - ('course_slot_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='programme_curriculum.courseslot')), - ('semester_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.semester')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'FinalRegistration', - }, - ), - migrations.CreateModel( - name='FeePayments', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('mode', models.CharField(choices=[('Axis Easypay', 'Axis Easypay'), ('Subpaisa', 'Subpaisa'), ('NEFT', 'NEFT'), ('RTGS', 'RTGS'), ('Bank Challan', 'Bank Challan'), ('Edu Loan', 'Edu Loan')], max_length=20)), - ('transaction_id', models.CharField(max_length=40)), - ('fee_receipt', models.FileField(null=True, upload_to='fee_receipt/')), - ('deposit_date', models.DateField(default=datetime.date.today)), - ('utr_number', models.CharField(max_length=40, null=True)), - ('fee_paid', models.IntegerField(default=0)), - ('reason', models.CharField(max_length=20, null=True)), - ('actual_fee', models.IntegerField(default=0)), - ('semester_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.semester')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'FeePayments', - }, - ), - migrations.CreateModel( - name='FeePayment', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('semester', models.IntegerField(default=1)), - ('batch', models.IntegerField(default=2016)), - ('mode', models.CharField(choices=[('Axis Easypay', 'Axis Easypay'), ('Subpaisa', 'Subpaisa'), ('NEFT', 'NEFT'), ('RTGS', 'RTGS'), ('Bank Challan', 'Bank Challan'), ('Edu Loan', 'Edu Loan')], max_length=20)), - ('transaction_id', models.CharField(max_length=40)), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='Dues', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('mess_due', models.IntegerField()), - ('hostel_due', models.IntegerField()), - ('library_due', models.IntegerField()), - ('placement_cell_due', models.IntegerField()), - ('academic_due', models.IntegerField()), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'Dues', - }, - ), - migrations.CreateModel( - name='CoursesMtech', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('specialization', models.CharField(choices=[('Power and Control', 'Power and Control'), ('Microwave and Communication Engineering', 'Microwave and Communication Engineering'), ('Micro-nano Electronics', 'Micro-nano Electronics'), ('CAD/CAM', 'CAD/CAM'), ('Design', 'Design'), ('Manufacturing', 'Manufacturing'), ('CSE', 'CSE'), ('Mechatronics', 'Mechatronics'), ('MDes', 'MDes'), ('all', 'all')], max_length=40)), - ('c_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.course')), - ], - ), - migrations.CreateModel( - name='CourseRequested', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('course_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.course')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'CourseRequested', - }, - ), - migrations.CreateModel( - name='course_registration', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('working_year', models.IntegerField(blank=True, choices=[(2023, 2023), (2022, 2022)], null=True)), - ('course_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.course')), - ('course_slot_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='programme_curriculum.courseslot')), - ('semester_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.semester')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'course_registration', - }, - ), - migrations.CreateModel( - name='BranchChange', - fields=[ - ('c_id', models.AutoField(primary_key=True, serialize=False)), - ('applied_date', models.DateField(default=datetime.datetime.now)), - ('branches', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.departmentinfo')), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='Bonafide', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('student_name', models.CharField(max_length=50)), - ('purpose', models.CharField(max_length=100)), - ('academic_year', models.CharField(max_length=15)), - ('enrolled_course', models.CharField(max_length=10)), - ('complaint_date', models.DateTimeField(default=django.utils.timezone.now)), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'Bonafide', - }, - ), - migrations.CreateModel( - name='AssistantshipClaim', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date', models.DateTimeField(auto_now_add=True)), - ('month', models.CharField(choices=[('Jan', 'January'), ('Feb', 'Febuary'), ('Mar', 'March'), ('Apr', 'April'), ('May', 'May'), ('Jun', 'June'), ('Jul', 'July'), ('Aug', 'August'), ('Sep', 'September'), ('Oct', 'October'), ('Nov', 'November'), ('Dec', 'December')], max_length=10)), - ('year', models.IntegerField(choices=[(2023, 2023), (2022, 2022)])), - ('bank_account', models.CharField(max_length=11)), - ('applicability', models.CharField(choices=[('GATE', 'GATE'), ('NET', 'NET'), ('CEED', 'CEED')], max_length=5)), - ('ta_supervisor_remark', models.BooleanField(default=False)), - ('thesis_supervisor_remark', models.BooleanField(default=False)), - ('hod_approval', models.BooleanField(default=False)), - ('acad_approval', models.BooleanField(default=False)), - ('account_approval', models.BooleanField(default=False)), - ('stipend', models.IntegerField(default=0)), - ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ('ta_supervisor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='TA_SUPERVISOR', to='globals.faculty')), - ('thesis_supervisor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='THESIS_SUPERVISOR', to='globals.faculty')), - ], - ), - migrations.CreateModel( - name='Register', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('year', models.IntegerField(default=2023)), - ('semester', models.IntegerField()), - ('curr_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.curriculum')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'Register', - 'unique_together': {('curr_id', 'student_id')}, - }, - ), - ] diff --git a/FusionIIIT/applications/academic_procedures/migrations/__init__.py b/FusionIIIT/applications/academic_procedures/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/central_mess/.DS_Store b/FusionIIIT/applications/central_mess/.DS_Store new file mode 100644 index 000000000..43fff49ae Binary files /dev/null and b/FusionIIIT/applications/central_mess/.DS_Store differ diff --git a/FusionIIIT/applications/central_mess/migrations/0001_initial.py b/FusionIIIT/applications/central_mess/migrations/0001_initial.py deleted file mode 100644 index 2a5bce41c..000000000 --- a/FusionIIIT/applications/central_mess/migrations/0001_initial.py +++ /dev/null @@ -1,186 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -import applications.central_mess.models -import datetime -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('academic_information', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Menu', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('mess_option', models.CharField(choices=[('mess1', 'Veg_mess'), ('mess2', 'Non_veg_mess')], default='mess2', max_length=20)), - ('meal_time', models.CharField(choices=[('MB', 'Monday Breakfast'), ('ML', 'Monday Lunch'), ('MD', 'Monday Dinner'), ('TB', 'Tuesday Breakfast'), ('TL', 'Tuesday Lunch'), ('TD', 'Tuesday Dinner'), ('WB', 'Wednesday Breakfast'), ('WL', 'Wednesday Lunch'), ('WD', 'Wednesday Dinner'), ('THB', 'Thursday Breakfast'), ('THL', 'Thursday Lunch'), ('THD', 'Thursday Dinner'), ('FB', 'Friday Breakfast'), ('FL', 'Friday Lunch'), ('FD', 'Friday Dinner'), ('SB', 'Saturday Breakfast'), ('SL', 'Saturday Lunch'), ('SD', 'Saturday Dinner'), ('SUB', 'Sunday Breakfast'), ('SUL', 'Sunday Lunch'), ('SUD', 'Sunday Dinner')], max_length=20)), - ('dish', models.CharField(max_length=200)), - ], - ), - migrations.CreateModel( - name='Mess_meeting', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('meet_date', models.DateField()), - ('agenda', models.TextField()), - ('venue', models.TextField()), - ('meeting_time', models.CharField(choices=[('10', '10 a.m.'), ('11', '11 a.m.'), ('12', '12 p.m.'), ('13', '1 p.m.'), ('14', '2 p.m.'), ('15', '3 p.m.'), ('16', '4 p.m.'), ('17', '5 p.m.'), ('18', '6 p.m.'), ('19', '7 p.m.'), ('20', '8 p.m.'), ('21', '9 p.m.')], max_length=20)), - ], - ), - migrations.CreateModel( - name='Mess_reg', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('sem', models.IntegerField(default='1')), - ('start_reg', models.DateField(default=datetime.date.today)), - ('end_reg', models.DateField(default=datetime.date.today)), - ], - ), - migrations.CreateModel( - name='MessBillBase', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('bill_amount', models.PositiveIntegerField(default=0)), - ('timestamp', models.DateTimeField(auto_now_add=True)), - ], - ), - migrations.CreateModel( - name='Nonveg_menu', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('dish', models.CharField(max_length=20)), - ('price', models.IntegerField()), - ('order_interval', models.CharField(choices=[('Breakfast', 'Breakfast'), ('Lunch', 'Lunch'), ('Dinner', 'Dinner')], default='Breakfast', max_length=20)), - ], - ), - migrations.CreateModel( - name='Vacation_food', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('start_date', models.DateField(default=datetime.date.today)), - ('end_date', models.DateField(default=datetime.date.today)), - ('purpose', models.TextField()), - ('status', models.CharField(choices=[('0', 'rejected'), ('1', 'pending'), ('2', 'accepted')], default='1', max_length=20)), - ('app_date', models.DateField(default=datetime.date.today)), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='Special_request', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('start_date', models.DateField(default=datetime.date.today)), - ('end_date', models.DateField(default=datetime.date.today)), - ('request', models.TextField()), - ('status', models.CharField(choices=[('0', 'rejected'), ('1', 'pending'), ('2', 'accepted')], default='1', max_length=20)), - ('item1', models.CharField(max_length=50)), - ('item2', models.CharField(max_length=50)), - ('app_date', models.DateField(default=datetime.date.today)), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='Rebate', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('start_date', models.DateField(default=datetime.date.today)), - ('end_date', models.DateField(default=datetime.date.today)), - ('purpose', models.TextField()), - ('status', models.CharField(choices=[('0', 'rejected'), ('1', 'pending'), ('2', 'accepted')], default='1', max_length=20)), - ('app_date', models.DateField(default=datetime.date.today)), - ('leave_type', models.CharField(choices=[('casual', 'Casual'), ('vacation', 'Vacation')], default='casual', max_length=20)), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='Nonveg_data', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('order_date', models.DateField(default=datetime.date.today)), - ('order_interval', models.CharField(choices=[('Breakfast', 'Breakfast'), ('Lunch', 'Lunch'), ('Dinner', 'Dinner')], default='Breakfast', max_length=20)), - ('app_date', models.DateField(default=datetime.date.today)), - ('dish', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='central_mess.nonveg_menu')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='Mess_minutes', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('mess_minutes', models.FileField(upload_to='central_mess/')), - ('meeting_date', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='central_mess.mess_meeting')), - ], - ), - migrations.CreateModel( - name='Menu_change_request', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('reason', models.TextField()), - ('request', models.CharField(max_length=100)), - ('status', models.CharField(choices=[('0', 'rejected'), ('1', 'pending'), ('2', 'accepted')], default='1', max_length=20)), - ('app_date', models.DateField(default=datetime.date.today)), - ('dish', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='central_mess.menu')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='Feedback', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('mess', models.CharField(choices=[('mess1', 'Veg_mess'), ('mess2', 'Non_veg_mess')], default='mess1', max_length=10)), - ('mess_rating', models.PositiveSmallIntegerField(default='5')), - ('fdate', models.DateField(default=datetime.date.today)), - ('description', models.TextField()), - ('feedback_type', models.CharField(choices=[('maintenance', 'Maintenance'), ('food', 'Food'), ('cleanliness', 'Cleanliness & Hygiene'), ('others', 'Others')], max_length=20)), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='Payments', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('sem', models.IntegerField()), - ('year', models.IntegerField(default=applications.central_mess.models.current_year)), - ('amount_paid', models.IntegerField(default=0)), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'unique_together': {('student_id', 'sem', 'year')}, - }, - ), - migrations.CreateModel( - name='Monthly_bill', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('month', models.CharField(default=applications.central_mess.models.current_month, max_length=20)), - ('year', models.IntegerField(default=applications.central_mess.models.current_year)), - ('amount', models.IntegerField(default=0)), - ('rebate_count', models.IntegerField(default=0)), - ('rebate_amount', models.IntegerField(default=0)), - ('nonveg_total_bill', models.IntegerField(default=0)), - ('total_bill', models.IntegerField(default=0)), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'unique_together': {('student_id', 'month', 'year')}, - }, - ), - migrations.CreateModel( - name='Messinfo', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('mess_option', models.CharField(choices=[('mess1', 'Veg_mess'), ('mess2', 'Non_veg_mess')], default='mess2', max_length=20)), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'unique_together': {('student_id', 'mess_option')}, - }, - ), - ] diff --git a/FusionIIIT/applications/central_mess/migrations/__init__.py b/FusionIIIT/applications/central_mess/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/complaint_system/.DS_Store b/FusionIIIT/applications/complaint_system/.DS_Store new file mode 100644 index 000000000..c4b588f28 Binary files /dev/null and b/FusionIIIT/applications/complaint_system/.DS_Store differ diff --git a/FusionIIIT/applications/complaint_system/migrations/0001_initial.py b/FusionIIIT/applications/complaint_system/migrations/0001_initial.py deleted file mode 100644 index db74dd14d..000000000 --- a/FusionIIIT/applications/complaint_system/migrations/0001_initial.py +++ /dev/null @@ -1,67 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -from django.db import migrations, models -import django.db.models.deletion -import django.utils.timezone - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('globals', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Caretaker', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('area', models.CharField(choices=[('hall-1', 'hall-1'), ('hall-3', 'hall-3'), ('hall-4', 'hall-4'), ('CC1', 'CC1'), ('CC2', 'CC2'), ('core_lab', 'core_lab'), ('LHTC', 'LHTC'), ('NR2', 'NR2'), ('Rewa_Residency', 'Rewa_Residency'), ('Maa Saraswati Hostel', 'Maa Saraswati Hostel'), ('Nagarjun Hostel', 'Nagarjun Hostel'), ('Panini Hostel', 'Panini Hostel')], default='hall-3', max_length=20)), - ('rating', models.IntegerField(default=0)), - ('myfeedback', models.CharField(default='this is my feedback', max_length=400)), - ('staff_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='Workers', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=50)), - ('age', models.CharField(max_length=10)), - ('phone', models.BigIntegerField(blank=True)), - ('worker_type', models.CharField(choices=[('Electricity', 'Electricity'), ('carpenter', 'carpenter'), ('plumber', 'plumber'), ('garbage', 'garbage'), ('dustbin', 'dustbin'), ('internet', 'internet'), ('other', 'other')], default='internet', max_length=20)), - ('caretaker_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='complaint_system.caretaker')), - ], - ), - migrations.CreateModel( - name='Supervisor', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('area', models.CharField(choices=[('hall-1', 'hall-1'), ('hall-3', 'hall-3'), ('hall-4', 'hall-4'), ('CC1', 'CC1'), ('CC2', 'CC2'), ('core_lab', 'core_lab'), ('LHTC', 'LHTC'), ('NR2', 'NR2'), ('Rewa_Residency', 'Rewa_Residency'), ('Maa Saraswati Hostel', 'Maa Saraswati Hostel'), ('Nagarjun Hostel', 'Nagarjun Hostel'), ('Panini Hostel', 'Panini Hostel')], max_length=20)), - ('sup_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='StudentComplain', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('complaint_date', models.DateTimeField(default=django.utils.timezone.now)), - ('complaint_finish', models.DateField(blank=True, null=True)), - ('complaint_type', models.CharField(choices=[('Electricity', 'Electricity'), ('carpenter', 'carpenter'), ('plumber', 'plumber'), ('garbage', 'garbage'), ('dustbin', 'dustbin'), ('internet', 'internet'), ('other', 'other')], default='internet', max_length=20)), - ('location', models.CharField(choices=[('hall-1', 'hall-1'), ('hall-3', 'hall-3'), ('hall-4', 'hall-4'), ('CC1', 'CC1'), ('CC2', 'CC2'), ('core_lab', 'core_lab'), ('LHTC', 'LHTC'), ('NR2', 'NR2'), ('Rewa_Residency', 'Rewa_Residency'), ('Maa Saraswati Hostel', 'Maa Saraswati Hostel'), ('Nagarjun Hostel', 'Nagarjun Hostel'), ('Panini Hostel', 'Panini Hostel')], max_length=20)), - ('specific_location', models.CharField(blank=True, max_length=50)), - ('details', models.CharField(max_length=100)), - ('status', models.IntegerField(default='0')), - ('remarks', models.CharField(default='Pending', max_length=300)), - ('flag', models.IntegerField(default='0')), - ('reason', models.CharField(blank=True, default='None', max_length=100)), - ('feedback', models.CharField(blank=True, max_length=500)), - ('upload_complaint', models.FileField(blank=True, upload_to='')), - ('comment', models.CharField(default='None', max_length=100)), - ('complainer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ('worker_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='complaint_system.workers')), - ], - ), - ] diff --git a/FusionIIIT/applications/complaint_system/migrations/__init__.py b/FusionIIIT/applications/complaint_system/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/counselling_cell/.DS_Store b/FusionIIIT/applications/counselling_cell/.DS_Store new file mode 100644 index 000000000..501a3d083 Binary files /dev/null and b/FusionIIIT/applications/counselling_cell/.DS_Store differ diff --git a/FusionIIIT/applications/counselling_cell/migrations/0001_initial.py b/FusionIIIT/applications/counselling_cell/migrations/0001_initial.py deleted file mode 100644 index b87618488..000000000 --- a/FusionIIIT/applications/counselling_cell/migrations/0001_initial.py +++ /dev/null @@ -1,111 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -import datetime -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('academic_information', '0001_initial'), - ('globals', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='CounsellingIssueCategory', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('category_id', models.CharField(max_length=40, unique=True)), - ('category', models.CharField(max_length=40)), - ], - ), - migrations.CreateModel( - name='CounsellingMeeting', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('meeting_date', models.DateField(default=datetime.date.today)), - ('meeting_time', models.CharField(choices=[('10', '10 a.m.'), ('11', '11 a.m.'), ('12', '12 p.m.'), ('13', '1 p.m.'), ('14', '2 p.m.'), ('15', '3 p.m.'), ('16', '4 p.m.'), ('17', '5 p.m.'), ('18', '6 p.m.'), ('19', '7 p.m.'), ('20', '8 p.m.'), ('21', '9 p.m.')], max_length=20)), - ('agenda', models.TextField()), - ('venue', models.CharField(max_length=20)), - ('student_invities', models.TextField(default=None, max_length=500)), - ('meeting_host', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='FacultyCounsellingTeam', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('faculty_position', models.CharField(choices=[('head_counsellor', 'Head Counsellor'), ('faculty_counsellor', 'Faculty Counsellor')], max_length=50)), - ('faculty', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.faculty')), - ], - options={ - 'unique_together': {('faculty', 'faculty_position')}, - }, - ), - migrations.CreateModel( - name='StudentCounsellingTeam', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('student_position', models.CharField(choices=[('student_guide', 'Student Guide'), ('student_coordinator', 'Student Coordinator')], max_length=50)), - ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'unique_together': {('student_id', 'student_position')}, - }, - ), - migrations.CreateModel( - name='StudentMeetingRequest', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('requested_time', models.DateTimeField()), - ('description', models.TextField(max_length=1000)), - ('requested_meeting_status', models.CharField(choices=[('status_accepted', 'Accepted'), ('status_pending', 'Pending')], default='status_pending', max_length=20)), - ('recipient_reply', models.TextField(max_length=1000)), - ('requested_faculty_invitee', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='counselling_cell.facultycounsellingteam')), - ('requested_student_invitee', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='counselling_cell.studentcounsellingteam')), - ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='StudentCounsellingInfo', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('student', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ('student_guide', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='counselling_cell.studentcounsellingteam')), - ], - ), - migrations.CreateModel( - name='CounsellingMinutes', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('counselling_minutes', models.FileField(upload_to='counselling_cell/')), - ('counselling_meeting', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='counselling_cell.counsellingmeeting')), - ], - ), - migrations.CreateModel( - name='CounsellingIssue', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('issue_raised_date', models.DateTimeField(default=datetime.datetime.now)), - ('issue', models.TextField(max_length=500)), - ('issue_status', models.CharField(choices=[('status_unresolved', 'Unresolved'), ('status_resolved', 'Resolved'), ('status_inprogress', 'InProgress')], default='status_unresolved', max_length=20)), - ('response_remark', models.TextField(max_length=500, null=True)), - ('issue_category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='counselling_cell.counsellingissuecategory')), - ('resolved_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='CounsellingFAQ', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('counselling_question', models.TextField(max_length=1000)), - ('counselling_answer', models.TextField(max_length=5000)), - ('counselling_category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='counselling_cell.counsellingissuecategory')), - ], - ), - ] diff --git a/FusionIIIT/applications/counselling_cell/migrations/__init__.py b/FusionIIIT/applications/counselling_cell/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/department/.DS_Store b/FusionIIIT/applications/department/.DS_Store new file mode 100644 index 000000000..84c648258 Binary files /dev/null and b/FusionIIIT/applications/department/.DS_Store differ diff --git a/FusionIIIT/applications/department/migrations/0001_initial.py b/FusionIIIT/applications/department/migrations/0001_initial.py deleted file mode 100644 index fc8a34834..000000000 --- a/FusionIIIT/applications/department/migrations/0001_initial.py +++ /dev/null @@ -1,44 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -import datetime -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('globals', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='SpecialRequest', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('request_date', models.DateTimeField(default=datetime.date.today)), - ('brief', models.CharField(default='--', max_length=20)), - ('request_details', models.CharField(max_length=200)), - ('upload_request', models.FileField(blank=True, upload_to='')), - ('status', models.CharField(default='Pending', max_length=50)), - ('remarks', models.CharField(default='--', max_length=300)), - ('request_receiver', models.CharField(default='--', max_length=30)), - ('request_maker', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='Announcements', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('ann_date', models.DateTimeField(default='04-04-2021')), - ('message', models.CharField(max_length=200)), - ('batch', models.CharField(default='Year-1', max_length=40)), - ('department', models.CharField(default='ALL', max_length=40)), - ('programme', models.CharField(max_length=10)), - ('upload_announcement', models.FileField(default=' ', null=True, upload_to='department/upload_announcement')), - ('maker_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - ] diff --git a/FusionIIIT/applications/department/migrations/__init__.py b/FusionIIIT/applications/department/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/department/views.py b/FusionIIIT/applications/department/views.py index ef7e71c64..f138c77db 100644 --- a/FusionIIIT/applications/department/views.py +++ b/FusionIIIT/applications/department/views.py @@ -178,7 +178,7 @@ def faculty_view(request): upload_announcement=upload_announcement, department = department, ann_date=ann_date) - # department_notif(usrnm, recipients , message) + department_notif(usrnm, recipients , message) context = browse_announcements() return render(request, 'department/dep_request.html', {"user_designation":user_info.user_type, @@ -223,7 +223,7 @@ def staff_view(request): upload_announcement=upload_announcement, department = department, ann_date=ann_date) - # department_notif(usrnm, recipients , message) + department_notif(usrnm, recipients , message) context = browse_announcements() return render(request, 'department/dep_request.html', {"user_designation":user_info.user_type, diff --git a/FusionIIIT/applications/eis/.DS_Store b/FusionIIIT/applications/eis/.DS_Store new file mode 100644 index 000000000..f72d4e850 Binary files /dev/null and b/FusionIIIT/applications/eis/.DS_Store differ diff --git a/FusionIIIT/applications/eis/migrations/0001_initial.py b/FusionIIIT/applications/eis/migrations/0001_initial.py deleted file mode 100644 index 2fd2e65d3..000000000 --- a/FusionIIIT/applications/eis/migrations/0001_initial.py +++ /dev/null @@ -1,280 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -import datetime -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('auth', '0012_alter_user_first_name_max_length'), - ] - - operations = [ - migrations.CreateModel( - name='faculty_about', - fields=[ - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='auth.user')), - ('about', models.TextField(max_length=1000)), - ('doj', models.DateField(default=datetime.datetime.now)), - ('education', models.TextField(max_length=500)), - ('interest', models.TextField(max_length=500)), - ('contact', models.CharField(blank=True, max_length=10, null=True)), - ('github', models.CharField(blank=True, max_length=100, null=True)), - ('linkedin', models.CharField(blank=True, max_length=100, null=True)), - ], - ), - migrations.CreateModel( - name='emp_visits', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pf_no', models.CharField(max_length=20)), - ('v_type', models.IntegerField(default=1)), - ('country', models.CharField(default=' ', max_length=500)), - ('place', models.CharField(default=' ', max_length=500)), - ('purpose', models.CharField(default=' ', max_length=500)), - ('v_date', models.DateField(blank=True, null=True)), - ('start_date', models.DateField(blank=True, null=True)), - ('end_date', models.DateField(blank=True, null=True)), - ('entry_date', models.DateField(blank=True, default=datetime.datetime.now, null=True)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='emp_techtransfer', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pf_no', models.IntegerField()), - ('details', models.CharField(default=' ', max_length=500)), - ('date_entry', models.DateField(blank=True, default=datetime.datetime.now, null=True)), - ('start_date', models.DateField(blank=True, null=True)), - ('end_date', models.DateField(blank=True, null=True)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='emp_session_chair', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pf_no', models.IntegerField()), - ('name', models.CharField(default=' ', max_length=500)), - ('event', models.TextField(default=' ', max_length=2500)), - ('s_year', models.IntegerField(blank=True, choices=[(1995, 1995), (1996, 1996), (1997, 1997), (1998, 1998), (1999, 1999), (2000, 2000), (2001, 2001), (2002, 2002), (2003, 2003), (2004, 2004), (2005, 2005), (2006, 2006), (2007, 2007), (2008, 2008), (2009, 2009), (2010, 2010), (2011, 2011), (2012, 2012), (2013, 2013), (2014, 2014), (2015, 2015), (2016, 2016), (2017, 2017)], null=True, verbose_name='year')), - ('a_month', models.IntegerField(blank=True, choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10), (11, 11), (12, 12)], default=1, null=True, verbose_name='Month')), - ('start_date', models.DateField(blank=True, null=True)), - ('end_date', models.DateField(blank=True, null=True)), - ('date_entry', models.DateField(blank=True, default=datetime.datetime.now, null=True)), - ('remarks', models.CharField(default=' ', max_length=1000)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='emp_research_projects', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pf_no', models.IntegerField()), - ('ptype', models.CharField(default='Research', max_length=100)), - ('pi', models.CharField(default=' ', max_length=1000)), - ('co_pi', models.CharField(default=' ', max_length=1500)), - ('title', models.TextField(default=' ', max_length=5000)), - ('funding_agency', models.CharField(default=' ', max_length=250, null=True)), - ('financial_outlay', models.CharField(default=' ', max_length=150, null=True)), - ('status', models.CharField(choices=[('Awarded', 'Awarded'), ('Submitted', 'Submitted'), ('Ongoing', 'Ongoing'), ('Completed', 'Completed')], max_length=10)), - ('start_date', models.DateField(blank=True, null=True)), - ('finish_date', models.DateField(blank=True, null=True)), - ('date_submission', models.DateField(blank=True, null=True)), - ('date_entry', models.DateField(blank=True, default=datetime.datetime.now, null=True)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='emp_research_papers', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pf_no', models.IntegerField()), - ('rtype', models.CharField(choices=[('Journal', 'Journal'), ('Conference', 'Conference')], default='Conference', max_length=500)), - ('authors', models.CharField(blank=True, max_length=2500, null=True)), - ('co_authors', models.CharField(blank=True, max_length=2500, null=True)), - ('title_paper', models.CharField(blank=True, max_length=2500, null=True)), - ('name', models.CharField(blank=True, max_length=2500, null=True)), - ('paper', models.CharField(blank=True, max_length=1000, null=True)), - ('venue', models.CharField(blank=True, max_length=2500, null=True)), - ('volume_no', models.CharField(blank=True, max_length=500, null=True)), - ('page_no', models.CharField(blank=True, max_length=500, null=True)), - ('is_sci', models.CharField(blank=True, choices=[('SCI', 'SCI'), ('SCIE', 'SCIE')], max_length=6, null=True)), - ('isbn_no', models.CharField(blank=True, max_length=250, null=True)), - ('doi', models.CharField(blank=True, max_length=1000, null=True)), - ('start_date', models.DateField(blank=True, null=True)), - ('end_date', models.DateField(blank=True, null=True)), - ('date_acceptance', models.DateField(blank=True, null=True)), - ('date_publication', models.DateField(blank=True, null=True)), - ('year', models.CharField(blank=True, choices=[(1995, 1995), (1996, 1996), (1997, 1997), (1998, 1998), (1999, 1999), (2000, 2000), (2001, 2001), (2002, 2002), (2003, 2003), (2004, 2004), (2005, 2005), (2006, 2006), (2007, 2007), (2008, 2008), (2009, 2009), (2010, 2010), (2011, 2011), (2012, 2012), (2013, 2013), (2014, 2014), (2015, 2015), (2016, 2016), (2017, 2017), (2018, 2018), (2019, 2019), (2020, 2020), (2021, 2021), (2022, 2022), (2023, 2023)], max_length=10, null=True)), - ('a_month', models.CharField(blank=True, choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10), (11, 11), (12, 12)], default=1, max_length=500, null=True)), - ('doc_id', models.CharField(blank=True, max_length=50, null=True)), - ('doc_description', models.CharField(blank=True, max_length=1000, null=True)), - ('date_entry', models.DateField(blank=True, default=datetime.datetime.now, null=True)), - ('status', models.CharField(blank=True, choices=[('Published', 'Published'), ('Accepted', 'Accepted'), ('Communicated', 'Communicated')], max_length=15, null=True)), - ('date_submission', models.DateTimeField(blank=True, null=True)), - ('reference_number', models.CharField(blank=True, max_length=100, null=True)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='emp_published_books', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pf_no', models.IntegerField()), - ('p_type', models.CharField(choices=[('Book', 'Book'), ('Monograph', 'Monograph'), ('Book Chapter', 'Book Chapter'), ('Handbook', 'Handbook'), ('Technical Report', 'Technical Report')], max_length=16)), - ('title', models.CharField(default=' ', max_length=2500)), - ('publisher', models.CharField(default=' ', max_length=2500)), - ('pyear', models.IntegerField(blank=True, choices=[(1995, 1995), (1996, 1996), (1997, 1997), (1998, 1998), (1999, 1999), (2000, 2000), (2001, 2001), (2002, 2002), (2003, 2003), (2004, 2004), (2005, 2005), (2006, 2006), (2007, 2007), (2008, 2008), (2009, 2009), (2010, 2010), (2011, 2011), (2012, 2012), (2013, 2013), (2014, 2014), (2015, 2015), (2016, 2016), (2017, 2017), (2018, 2018), (2019, 2019), (2020, 2020), (2021, 2021), (2022, 2022), (2023, 2023)], null=True, verbose_name='year')), - ('authors', models.CharField(default=' ', max_length=250)), - ('date_entry', models.DateField(blank=True, default=datetime.datetime.now, null=True)), - ('publication_date', models.DateField(blank=True, null=True)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='emp_patents', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pf_no', models.IntegerField()), - ('p_no', models.CharField(max_length=150)), - ('title', models.CharField(max_length=1500)), - ('earnings', models.IntegerField(default=0)), - ('status', models.CharField(choices=[('Filed', 'Filed'), ('Granted', 'Granted'), ('Published', 'Published'), ('Owned', 'Owned')], max_length=15)), - ('p_year', models.IntegerField(blank=True, choices=[(1995, 1995), (1996, 1996), (1997, 1997), (1998, 1998), (1999, 1999), (2000, 2000), (2001, 2001), (2002, 2002), (2003, 2003), (2004, 2004), (2005, 2005), (2006, 2006), (2007, 2007), (2008, 2008), (2009, 2009), (2010, 2010), (2011, 2011), (2012, 2012), (2013, 2013), (2014, 2014), (2015, 2015), (2016, 2016), (2017, 2017), (2018, 2018), (2019, 2019), (2020, 2020), (2021, 2021), (2022, 2022), (2023, 2023)], null=True, verbose_name='year')), - ('a_month', models.IntegerField(blank=True, choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10), (11, 11), (12, 12)], default=1, null=True, verbose_name='Month')), - ('date_entry', models.DateField(blank=True, default=datetime.datetime.now, null=True)), - ('start_date', models.DateField(blank=True, null=True)), - ('end_date', models.DateField(blank=True, null=True)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='emp_mtechphd_thesis', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pf_no', models.IntegerField()), - ('degree_type', models.IntegerField(default=1)), - ('title', models.CharField(max_length=250)), - ('supervisors', models.CharField(max_length=250)), - ('co_supervisors', models.CharField(blank=True, max_length=250, null=True)), - ('rollno', models.CharField(max_length=200)), - ('s_name', models.CharField(max_length=5000)), - ('s_year', models.IntegerField(blank=True, choices=[(1995, 1995), (1996, 1996), (1997, 1997), (1998, 1998), (1999, 1999), (2000, 2000), (2001, 2001), (2002, 2002), (2003, 2003), (2004, 2004), (2005, 2005), (2006, 2006), (2007, 2007), (2008, 2008), (2009, 2009), (2010, 2010), (2011, 2011), (2012, 2012), (2013, 2013), (2014, 2014), (2015, 2015), (2016, 2016), (2017, 2017), (2018, 2018), (2019, 2019), (2020, 2020), (2021, 2021), (2022, 2022), (2023, 2023)], null=True, verbose_name='year')), - ('a_month', models.IntegerField(blank=True, choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10), (11, 11), (12, 12)], default=1, null=True, verbose_name='Month')), - ('date_entry', models.DateField(blank=True, default=datetime.datetime.now, null=True)), - ('start_date', models.DateField(blank=True, null=True)), - ('end_date', models.DateField(blank=True, null=True)), - ('semester', models.IntegerField(blank=True, default=1, null=True)), - ('status', models.CharField(blank=True, choices=[('Awarded', 'Awarded'), ('Submitted', 'Submitted'), ('Ongoing', 'Ongoing'), ('Completed', 'Completed')], max_length=10, null=True)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='emp_keynote_address', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pf_no', models.IntegerField()), - ('type', models.CharField(choices=[('Keynote', 'Keynote'), ('Plenary Address', 'Plenary Address')], default='Keynote', max_length=140)), - ('title', models.CharField(max_length=1000)), - ('name', models.CharField(max_length=1000)), - ('venue', models.CharField(max_length=1000)), - ('page_no', models.CharField(max_length=100)), - ('isbn_no', models.CharField(max_length=200)), - ('k_year', models.IntegerField(blank=True, choices=[(1995, 1995), (1996, 1996), (1997, 1997), (1998, 1998), (1999, 1999), (2000, 2000), (2001, 2001), (2002, 2002), (2003, 2003), (2004, 2004), (2005, 2005), (2006, 2006), (2007, 2007), (2008, 2008), (2009, 2009), (2010, 2010), (2011, 2011), (2012, 2012), (2013, 2013), (2014, 2014), (2015, 2015), (2016, 2016), (2017, 2017), (2018, 2018), (2019, 2019), (2020, 2020), (2021, 2021), (2022, 2022), (2023, 2023)], null=True, verbose_name='year')), - ('a_month', models.IntegerField(blank=True, choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10), (11, 11), (12, 12)], default=1, null=True, verbose_name='Month')), - ('start_date', models.DateField(blank=True, null=True)), - ('end_date', models.DateField(blank=True, null=True)), - ('date_entry', models.DateField(blank=True, default=datetime.datetime.now, null=True)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='emp_expert_lectures', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pf_no', models.IntegerField()), - ('l_type', models.CharField(choices=[('Expert Lecture', 'Expert Lecture'), ('Invited Talk', 'Invited Talk')], default='Expert Lecture', max_length=14)), - ('title', models.CharField(max_length=1000)), - ('place', models.CharField(max_length=1000)), - ('l_date', models.DateField(blank=True, null=True)), - ('l_year', models.IntegerField(blank=True, choices=[(1995, 1995), (1996, 1996), (1997, 1997), (1998, 1998), (1999, 1999), (2000, 2000), (2001, 2001), (2002, 2002), (2003, 2003), (2004, 2004), (2005, 2005), (2006, 2006), (2007, 2007), (2008, 2008), (2009, 2009), (2010, 2010), (2011, 2011), (2012, 2012), (2013, 2013), (2014, 2014), (2015, 2015), (2016, 2016), (2017, 2017), (2018, 2018), (2019, 2019), (2020, 2020), (2021, 2021), (2022, 2022), (2023, 2023)], null=True, verbose_name='year')), - ('a_month', models.IntegerField(blank=True, choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10), (11, 11), (12, 12)], default=1, null=True, verbose_name='Month')), - ('date_entry', models.DateField(blank=True, default=datetime.datetime.now, null=True)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='emp_event_organized', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pf_no', models.IntegerField()), - ('type', models.CharField(choices=[('Training Program', 'Training Program'), ('Seminar', 'Seminar'), ('Short Term Program', 'Short Term Program'), ('Workshop', 'Workshop'), ('Any Other', 'Any Other')], max_length=180)), - ('name', models.CharField(max_length=1000)), - ('sponsoring_agency', models.CharField(max_length=150)), - ('venue', models.CharField(max_length=100)), - ('role', models.CharField(choices=[('Convener', 'Convener'), ('Coordinator', 'Coordinator'), ('Co-Convener', 'Co-Convener')], max_length=11)), - ('start_date', models.DateField(blank=True, null=True)), - ('end_date', models.DateField(blank=True, null=True)), - ('date_entry', models.DateField(blank=True, default=datetime.datetime.now, null=True)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='emp_consultancy_projects', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pf_no', models.IntegerField()), - ('consultants', models.CharField(max_length=150)), - ('title', models.CharField(max_length=1000)), - ('client', models.CharField(max_length=1000)), - ('financial_outlay', models.IntegerField()), - ('start_date', models.DateField(blank=True, null=True)), - ('end_date', models.DateField(blank=True, null=True)), - ('duration', models.CharField(blank=True, max_length=500, null=True)), - ('date_entry', models.DateField(blank=True, default=datetime.datetime.now, null=True)), - ('status', models.CharField(blank=True, choices=[('Completed', 'Completed'), ('Submitted', 'Submitted'), ('Ongoing', 'Ongoing')], default='Ongoing', max_length=10, null=True)), - ('remarks', models.CharField(blank=True, max_length=1000, null=True)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='emp_confrence_organised', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pf_no', models.IntegerField()), - ('name', models.CharField(max_length=500)), - ('venue', models.CharField(max_length=500)), - ('k_year', models.IntegerField(blank=True, choices=[(1995, 1995), (1996, 1996), (1997, 1997), (1998, 1998), (1999, 1999), (2000, 2000), (2001, 2001), (2002, 2002), (2003, 2003), (2004, 2004), (2005, 2005), (2006, 2006), (2007, 2007), (2008, 2008), (2009, 2009), (2010, 2010), (2011, 2011), (2012, 2012), (2013, 2013), (2014, 2014), (2015, 2015), (2016, 2016), (2017, 2017), (2018, 2018), (2019, 2019), (2020, 2020), (2021, 2021), (2022, 2022), (2023, 2023)], null=True, verbose_name='year')), - ('a_month', models.IntegerField(blank=True, choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10), (11, 11), (12, 12)], default=1, null=True, verbose_name='Month')), - ('start_date', models.DateField(blank=True, null=True)), - ('end_date', models.DateField(blank=True, null=True)), - ('date_entry', models.DateField(blank=True, default=datetime.datetime.now, null=True)), - ('role1', models.CharField(blank=True, choices=[('Advisary Committee', 'Advisary Committee'), ('Program Committee', 'Program Committee'), ('Organised', 'Organised'), ('Conference Chair', 'Conference Chair'), ('Any Other', 'Any Other')], default='Any Other', max_length=200, null=True)), - ('role2', models.CharField(blank=True, max_length=200, null=True)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='emp_achievement', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pf_no', models.IntegerField()), - ('a_type', models.CharField(choices=[('Award', 'Award'), ('Honour', 'Honour'), ('Prize', 'Prize'), ('Other', 'Other')], default='Other', max_length=180)), - ('details', models.TextField(default=' ', max_length=1550)), - ('a_day', models.IntegerField(blank=True, choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10), (11, 11), (12, 12), (13, 13), (14, 14), (15, 15), (16, 16), (17, 17), (18, 18), (19, 19), (20, 20), (21, 21), (22, 22), (23, 23), (24, 24), (25, 25), (26, 26), (27, 27), (28, 28), (29, 29), (30, 30), (31, 31)], null=True, verbose_name='Day')), - ('a_month', models.IntegerField(blank=True, choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10), (11, 11), (12, 12)], null=True, verbose_name='Month')), - ('a_year', models.IntegerField(blank=True, choices=[(1995, 1995), (1996, 1996), (1997, 1997), (1998, 1998), (1999, 1999), (2000, 2000), (2001, 2001), (2002, 2002), (2003, 2003), (2004, 2004), (2005, 2005), (2006, 2006), (2007, 2007), (2008, 2008), (2009, 2009), (2010, 2010), (2011, 2011), (2012, 2012), (2013, 2013), (2014, 2014), (2015, 2015), (2016, 2016), (2017, 2017), (2018, 2018), (2019, 2019), (2020, 2020), (2021, 2021), (2022, 2022), (2023, 2023)], null=True, verbose_name='year')), - ('date_entry', models.DateField(default=datetime.datetime.now)), - ('achievment_date', models.DateField(blank=True, null=True)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - ] diff --git a/FusionIIIT/applications/eis/migrations/__init__.py b/FusionIIIT/applications/eis/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/establishment/.DS_Store b/FusionIIIT/applications/establishment/.DS_Store new file mode 100644 index 000000000..b7c627ee8 Binary files /dev/null and b/FusionIIIT/applications/establishment/.DS_Store differ diff --git a/FusionIIIT/applications/establishment/migrations/0001_initial.py b/FusionIIIT/applications/establishment/migrations/0001_initial.py deleted file mode 100644 index e1449d3b3..000000000 --- a/FusionIIIT/applications/establishment/migrations/0001_initial.py +++ /dev/null @@ -1,284 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('globals', '0001_initial'), - ('auth', '0012_alter_user_first_name_max_length'), - ] - - operations = [ - migrations.CreateModel( - name='Appraisal', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('discipline', models.CharField(max_length=30, null=True)), - ('knowledge_field', models.CharField(max_length=30, null=True)), - ('research_interest', models.CharField(max_length=60, null=True)), - ('status', models.CharField(choices=[('pending', 'Pending'), ('accepted', 'Accepted'), ('rejected', 'Rejected'), ('forwarded', 'Forwarded'), ('auto rejected', 'Auto Rejected'), ('outstanding', 'Outstanding'), ('excellant', 'Excellent'), ('very good', 'Very Good'), ('good', 'Good'), ('poor', 'Poor')], default='pending', max_length=20)), - ('timestamp', models.DateTimeField(auto_now=True, null=True)), - ('other_research_element', models.CharField(blank=True, default='', max_length=200, null=True)), - ('publications', models.CharField(blank=True, default='', max_length=200, null=True)), - ('conferences_meeting_attended', models.CharField(blank=True, default='', max_length=200, null=True)), - ('conferences_meeting_organized', models.CharField(blank=True, default='', max_length=200, null=True)), - ('admin_assign', models.CharField(blank=True, default='', max_length=200, null=True)), - ('sevice_to_ins', models.CharField(blank=True, default='', max_length=200, null=True)), - ('extra_info', models.CharField(blank=True, default='', max_length=200, null=True)), - ('faculty_comments', models.CharField(blank=True, default='', max_length=200, null=True)), - ('start_date', models.DateField(blank=True, null=True)), - ('end_date', models.DateField(blank=True, null=True)), - ('applicant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='all_appraisals', to=settings.AUTH_USER_MODEL)), - ('designation', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='desig', to='globals.designation')), - ], - ), - migrations.CreateModel( - name='Cpda_application', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('status', models.CharField(choices=[('requested', 'Requested'), ('approved', 'Approved'), ('rejected', 'Rejected'), ('adjustments_pending', 'Adjustments Pending'), ('finished', 'Finished')], max_length=20, null=True)), - ('pf_number', models.CharField(default='1', max_length=50, null=True)), - ('purpose', models.CharField(blank=True, default='', max_length=500)), - ('requested_advance', models.IntegerField(blank=True)), - ('request_timestamp', models.DateTimeField(auto_now=True, null=True)), - ('adjustment_amount', models.IntegerField(blank=True, default='0', null=True)), - ('bills_attached', models.IntegerField(blank=True, default='-1', null=True)), - ('total_bills_amount', models.IntegerField(blank=True, default='0', null=True)), - ('ppa_register_page_no', models.IntegerField(blank=True, default='-1', null=True)), - ('adjustment_timestamp', models.DateTimeField(auto_now=True, null=True)), - ('applicant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - options={ - 'db_table': 'Cpda Application', - }, - ), - migrations.CreateModel( - name='CpdaBalance', - fields=[ - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='auth.user')), - ('cpda_balance', models.PositiveIntegerField(default=300000)), - ], - ), - migrations.CreateModel( - name='Ltc_application', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('status', models.CharField(choices=[('requested', 'Requested'), ('approved', 'Approved'), ('rejected', 'Rejected')], max_length=20, null=True)), - ('pf_number', models.CharField(default='', max_length=50)), - ('basic_pay', models.IntegerField(blank=True)), - ('leave_start', models.DateField(null=True)), - ('leave_end', models.DateField()), - ('family_departure_date', models.DateField()), - ('leave_nature', models.CharField(default='', max_length=50)), - ('purpose', models.CharField(blank=True, default='', max_length=500)), - ('is_hometown_or_elsewhere', models.CharField(choices=[('hometown', 'Home Town'), ('elsewhere', 'Elsewhere')], max_length=50)), - ('phone_number', models.CharField(default='', max_length=13)), - ('address_during_leave', models.CharField(blank=True, default='', max_length=500)), - ('travel_mode', models.CharField(choices=[('rail', 'Rail'), ('road', 'Road')], max_length=50)), - ('ltc_availed', models.CharField(blank=True, default='', max_length=100)), - ('ltc_to_avail', models.CharField(blank=True, default='', max_length=200)), - ('dependents', models.CharField(blank=True, default='', max_length=500)), - ('requested_advance', models.IntegerField(blank=True)), - ('request_timestamp', models.DateTimeField(auto_now=True, null=True)), - ('review_timestamp', models.DateTimeField(auto_now=True, null=True)), - ('applicant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - options={ - 'db_table': 'Ltc Application', - }, - ), - migrations.CreateModel( - name='Ltc_eligible_user', - fields=[ - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='auth.user')), - ('date_of_joining', models.DateField(default='2005-04-01')), - ('current_block_size', models.IntegerField(default=4)), - ('total_ltc_allowed', models.IntegerField(default=2)), - ('hometown_ltc_allowed', models.IntegerField(default=2)), - ('elsewhere_ltc_allowed', models.IntegerField(default=1)), - ('hometown_ltc_availed', models.IntegerField(default=0)), - ('elsewhere_ltc_availed', models.IntegerField(default=0)), - ], - ), - migrations.CreateModel( - name='ThesisResearchSupervision', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('stud_name', models.CharField(max_length=30)), - ('thesis_title', models.CharField(blank=True, max_length=30, null=True)), - ('year', models.IntegerField(blank=True, null=True)), - ('semester', models.IntegerField()), - ('status', models.CharField(max_length=30)), - ('appraisal', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='applicants_supervised_stud', to='establishment.appraisal')), - ('co_supervisors', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='all_supervisors', to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='SponsoredProjects', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('project_title', models.CharField(max_length=30)), - ('sponsoring_agency', models.CharField(max_length=30)), - ('funding', models.IntegerField()), - ('duration', models.IntegerField()), - ('status', models.CharField(max_length=30)), - ('remarks', models.CharField(max_length=30)), - ('appraisal', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='applicant_sponsored_projects', to='establishment.appraisal')), - ('co_investigators', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='all_co_investigators', to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='NewCoursesOffered', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('course_name', models.CharField(max_length=30)), - ('course_num', models.IntegerField(blank=True, null=True)), - ('ug_or_pg', models.CharField(blank=True, max_length=2, null=True)), - ('tutorial_hrs_wk', models.FloatField(blank=True, null=True)), - ('year', models.IntegerField(blank=True, null=True)), - ('semester', models.IntegerField()), - ('appraisal', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='applicants_offered_new_courses', to='establishment.appraisal')), - ], - ), - migrations.CreateModel( - name='NewCourseMaterial', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('course_name', models.CharField(max_length=30)), - ('course_num', models.IntegerField(blank=True, null=True)), - ('ug_or_pg', models.CharField(blank=True, max_length=2, null=True)), - ('activity_type', models.CharField(blank=True, max_length=10, null=True)), - ('availiability', models.CharField(blank=True, max_length=10, null=True)), - ('appraisal', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='applicant_new_courses_material', to='establishment.appraisal')), - ], - ), - migrations.CreateModel( - name='Ltc_to_avail', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=30)), - ('age', models.IntegerField(blank=True, null=True)), - ('ltc', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ltcToAvail', to='establishment.ltc_application')), - ], - ), - migrations.CreateModel( - name='Ltc_availed', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=30)), - ('age', models.IntegerField(blank=True, null=True)), - ('ltc', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ltcAvailed', to='establishment.ltc_application')), - ], - ), - migrations.CreateModel( - name='Establishment_variables', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('est_admin', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Dependent', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=30)), - ('age', models.IntegerField(blank=True, null=True)), - ('depend', models.CharField(max_length=30)), - ('ltc', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='Dependent', to='establishment.ltc_application')), - ], - ), - migrations.CreateModel( - name='Cpda_bill', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('bill', models.FileField(blank=True, upload_to='')), - ('application', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='establishment.cpda_application')), - ], - options={ - 'db_table': 'Cpda Bills', - }, - ), - migrations.CreateModel( - name='CoursesInstructed', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('semester', models.IntegerField(blank=True, null=True)), - ('course_name', models.CharField(max_length=30)), - ('course_num', models.IntegerField(blank=True, null=True)), - ('lecture_hrs_wk', models.FloatField(blank=True, null=True)), - ('tutorial_hrs_wk', models.FloatField(blank=True, null=True)), - ('lab_hrs_wk', models.FloatField(blank=True, null=True)), - ('reg_students', models.IntegerField(blank=True, null=True)), - ('co_instructor', models.CharField(blank=True, max_length=250, null=True)), - ('appraisal', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='applicant_courses', to='establishment.appraisal')), - ], - ), - migrations.CreateModel( - name='AppraisalRequest', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('remark_hod', models.CharField(blank=True, max_length=50, null=True)), - ('remark_director', models.CharField(blank=True, max_length=50, null=True)), - ('status_hod', models.CharField(choices=[('pending', 'Pending'), ('accepted', 'Accepted'), ('rejected', 'Rejected'), ('forwarded', 'Forwarded'), ('auto rejected', 'Auto Rejected'), ('outstanding', 'Outstanding'), ('excellant', 'Excellent'), ('very good', 'Very Good'), ('good', 'Good'), ('poor', 'Poor')], default='pending', max_length=20)), - ('status_director', models.CharField(choices=[('pending', 'Pending'), ('accepted', 'Accepted'), ('rejected', 'Rejected'), ('forwarded', 'Forwarded'), ('auto rejected', 'Auto Rejected'), ('outstanding', 'Outstanding'), ('excellant', 'Excellent'), ('very good', 'Very Good'), ('good', 'Good'), ('poor', 'Poor')], default='pending', max_length=20)), - ('permission', models.CharField(blank=True, choices=[('intermediary', 'Intermediary Staff'), ('sanc_auth', 'Appraisal Sanctioning Authority'), ('sanc_off', 'Appraisal Sanctioning Officer')], default='sanc_auth', max_length=20, null=True)), - ('request_timestamp', models.DateTimeField(auto_now=True, null=True)), - ('appraisal', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='appraisal_tracking', to='establishment.appraisal')), - ('director', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='director', to=settings.AUTH_USER_MODEL)), - ('hod', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='hod', to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='AppraisalAdministrators', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('authority', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sanc_authority_of_ap', to='globals.designation')), - ('officer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sanc_officer_of_ap', to='globals.designation')), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='apprasial_admins', to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Ltc_tracking', - fields=[ - ('application', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='tracking_info', serialize=False, to='establishment.ltc_application')), - ('designations', models.CharField(blank=True, max_length=350, null=True)), - ('remarks', models.CharField(blank=True, max_length=350, null=True)), - ('review_status', models.CharField(choices=[('to_assign', 'To Assign'), ('under_review', 'Under Review'), ('reviewed', 'Reviewed')], max_length=20, null=True)), - ('admin_remarks', models.CharField(blank=True, max_length=200, null=True)), - ('reviewer_design', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='globals.designation')), - ('reviewer_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - options={ - 'db_table': 'Ltc Tracking', - }, - ), - migrations.CreateModel( - name='Cpda_tracking', - fields=[ - ('application', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='tracking_info', serialize=False, to='establishment.cpda_application')), - ('current_reviewer_id', models.IntegerField(blank=True, default=1)), - ('remarks', models.CharField(blank=True, max_length=250, null=True)), - ('remarks_rev1', models.CharField(blank=True, max_length=250, null=True)), - ('remarks_rev2', models.CharField(blank=True, max_length=250, null=True)), - ('remarks_rev3', models.CharField(blank=True, max_length=250, null=True)), - ('review_status', models.CharField(choices=[('to_assign', 'To Assign'), ('under_review', 'Under Review'), ('reviewed', 'Reviewed')], max_length=20, null=True)), - ('bill', models.FileField(blank=True, null=True, upload_to='')), - ('reviewer_design', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='desig1', to='globals.designation')), - ('reviewer_design2', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='desig2', to='globals.designation')), - ('reviewer_design3', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='desig3', to='globals.designation')), - ('reviewer_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='reviewer1', to=settings.AUTH_USER_MODEL)), - ('reviewer_id2', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='reviewer2', to=settings.AUTH_USER_MODEL)), - ('reviewer_id3', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='reviewer3', to=settings.AUTH_USER_MODEL)), - ], - options={ - 'db_table': 'Cpda Tracking', - }, - ), - ] diff --git a/FusionIIIT/applications/establishment/migrations/__init__.py b/FusionIIIT/applications/establishment/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/estate_module/.DS_Store b/FusionIIIT/applications/estate_module/.DS_Store new file mode 100644 index 000000000..509b8288b Binary files /dev/null and b/FusionIIIT/applications/estate_module/.DS_Store differ diff --git a/FusionIIIT/applications/estate_module/migrations/0001_initial.py b/FusionIIIT/applications/estate_module/migrations/0001_initial.py deleted file mode 100644 index 478a93b83..000000000 --- a/FusionIIIT/applications/estate_module/migrations/0001_initial.py +++ /dev/null @@ -1,126 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.CreateModel( - name='Building', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=100)), - ('dateIssued', models.DateField()), - ('dateConstructionStarted', models.DateField(blank=True, null=True)), - ('dateConstructionCompleted', models.DateField(blank=True, null=True)), - ('dateOperational', models.DateField(blank=True, null=True)), - ('status', models.CharField(choices=[('OS', 'On Schedule'), ('DL', 'Delayed')], default='OS', max_length=2)), - ('area', models.IntegerField(blank=True, null=True)), - ('constructionCostEstimated', models.IntegerField(blank=True, null=True)), - ('constructionCostActual', models.IntegerField(blank=True, null=True)), - ('numRooms', models.IntegerField(blank=True, null=True)), - ('numWashrooms', models.IntegerField(blank=True, null=True)), - ('remarks', models.TextField(blank=True, null=True)), - ('verified', models.BooleanField(default=False)), - ], - options={ - 'ordering': ['-id'], - }, - ), - migrations.CreateModel( - name='InventoryType', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=100)), - ('rate', models.IntegerField()), - ('manufacturer', models.CharField(blank=True, max_length=100, null=True)), - ('model', models.CharField(blank=True, max_length=100, null=True)), - ('remarks', models.TextField(blank=True, null=True)), - ], - ), - migrations.CreateModel( - name='Work', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=100)), - ('workType', models.CharField(choices=[('CW', 'Construction'), ('MW', 'Maintenance')], default='MW', max_length=2)), - ('contractorName', models.CharField(max_length=100)), - ('status', models.CharField(choices=[('OS', 'On Schedule'), ('DL', 'Delayed')], default='OS', max_length=2)), - ('dateIssued', models.DateField()), - ('dateStarted', models.DateField(blank=True, null=True)), - ('dateCompleted', models.DateField(blank=True, null=True)), - ('costEstimated', models.IntegerField(blank=True, null=True)), - ('costActual', models.IntegerField(blank=True, null=True)), - ('remarks', models.TextField(blank=True, null=True)), - ('verified', models.BooleanField(default=False)), - ('building', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='estate_module.building')), - ], - options={ - 'ordering': ['-id'], - }, - ), - migrations.CreateModel( - name='SubWork', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=100)), - ('dateIssued', models.DateField()), - ('dateStarted', models.DateField(blank=True, null=True)), - ('dateCompleted', models.DateField(blank=True, null=True)), - ('costEstimated', models.IntegerField(blank=True, null=True)), - ('costActual', models.IntegerField(blank=True, null=True)), - ('remarks', models.TextField(blank=True, null=True)), - ('work', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='estate_module.work')), - ], - options={ - 'ordering': ['-id'], - }, - ), - migrations.CreateModel( - name='InventoryNonConsumable', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('quantity', models.IntegerField()), - ('dateOrdered', models.DateField()), - ('dateReceived', models.DateField(blank=True, null=True)), - ('remarks', models.TextField(blank=True, null=True)), - ('serial_no', models.CharField(max_length=20)), - ('dateLastVerified', models.DateField()), - ('building', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='estate_module.building')), - ('inventoryType', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='estate_module.inventorytype')), - ('issued_to', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), - ('work', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='estate_module.work')), - ], - options={ - 'ordering': ['-id'], - 'abstract': False, - }, - ), - migrations.CreateModel( - name='InventoryConsumable', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('quantity', models.IntegerField()), - ('dateOrdered', models.DateField()), - ('dateReceived', models.DateField(blank=True, null=True)), - ('remarks', models.TextField(blank=True, null=True)), - ('presentQuantity', models.IntegerField()), - ('building', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='estate_module.building')), - ('inventoryType', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='estate_module.inventorytype')), - ('work', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='estate_module.work')), - ], - options={ - 'ordering': ['-id'], - 'abstract': False, - }, - ), - ] diff --git a/FusionIIIT/applications/estate_module/migrations/__init__.py b/FusionIIIT/applications/estate_module/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/estate_module/static/estate_module/sidebar.js b/FusionIIIT/applications/estate_module/static/estate_module/sidebar.js index 462ebb004..449a7f5c8 100644 --- a/FusionIIIT/applications/estate_module/static/estate_module/sidebar.js +++ b/FusionIIIT/applications/estate_module/static/estate_module/sidebar.js @@ -36,7 +36,7 @@ $(document).ready(function () { .sidebar('setting', 'transition', 'overlay'); }); function newNotification() { - console.log('A new Notification added!'); + // console.log('A new Notification added!'); var notifactionName = document.createTextNode('Kanishka Munshi'); var notificationEmail = document.createTextNode('gmail@zlatan.com'); diff --git a/FusionIIIT/applications/feeds/.DS_Store b/FusionIIIT/applications/feeds/.DS_Store new file mode 100644 index 000000000..b0aecb235 Binary files /dev/null and b/FusionIIIT/applications/feeds/.DS_Store differ diff --git a/FusionIIIT/applications/feeds/migrations/0001_initial.py b/FusionIIIT/applications/feeds/migrations/0001_initial.py deleted file mode 100644 index 30ae94c92..000000000 --- a/FusionIIIT/applications/feeds/migrations/0001_initial.py +++ /dev/null @@ -1,148 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import django.utils.timezone - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.CreateModel( - name='AllTags', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('tag', models.CharField(choices=[('CSE', 'CSE'), ('ECE', 'ECE'), ('Mechanical', 'Mechanical'), ('Technical-Clubs', 'Technical Clubs'), ('Cultural-Clubs', 'Cultural Clubs'), ('Sports-Clubs', 'Sports Clubs'), ('Business-and-Career', 'Business and Career'), ('Entertainment', 'Entertainment'), ('IIITDMJ-Campus', 'IIITDMJ Campus'), ('Jabalpur-city', 'Jabalpur city'), ('IIITDMJ-Rules-and-Regulations', 'IIITDMJ rules and regulations'), ('Academics', 'Academics'), ('IIITDMJ', 'IIITDMJ'), ('Life-Relationship-and-Self', 'Life Relationship and Self'), ('Technology-and-Education', 'Technology and Education'), ('Programmes', 'Programmes'), ('Others', 'Others'), ('Design', 'Design')], default='CSE', max_length=100)), - ('subtag', models.CharField(choices=[('Web-Development', 'Web Development'), ('Competitive-Programming', 'Competitive Programming'), ('Programming-Languages', 'Programming-Languages'), ('Data-Science', 'Data-Science'), ('Ethical-Hacking-and-Cyber-Security', 'Ethical hacking and cyber security'), ('Cryptography-and-Network-Security', 'cryptography and network security'), ('Software-Engineering', 'Software-Engineering'), ('Algorithm', 'Algorithm'), ('Mobile-Development', 'Mobile-Development'), ('Game-Development', 'Game-Development'), ('Artificial-Intelligence', 'Artificial Intelligence'), ('Electronics-Circuit-Design', 'Electronics Circuit Design'), ('Wireless-Communication', 'Wireless Communication'), ('Embedded-System', 'Embedded Systems'), ('VLSI', 'VLSI'), ('Control-System', 'Control Systems'), ('Robotics-and-others', 'Robotics and Others'), ('Microcontrollers', 'Microcontrollers'), ('IOT', 'IOT'), ('Robotics', 'Robotics'), ('Thermodynamics', 'Thermodynamics'), ('Nanatechnology', 'Nanatechnology'), ('Manufacturing', 'Manufacturing'), ('Programming-and-Webix-Club', 'Programming and Webix Club'), ('Electronics-Club', 'Electronics Club'), ('Business-and-Management-Club', 'Business and Management Club'), ('Robotics-Club', 'Robotics Club'), ('CAD-Club', 'CAD Club'), ('Astronomy-and-Physics-Society', 'ASTRONOMY AND PHYSICS SOCIETY'), ('Aakriti-The-Film-Making-and-Photography-Club', 'AAKRITI-THE FILM MAKING AND PHOTOGRAPHY CLUB'), ('AUTOMOTIVE-AND-FABRICATION-CLUB', 'AUTOMOTIVE AND FABRICATION CLUB'), ('RACING-CLUB', 'RACING CLUB'), ('SAAZ-MUSIC-CLUB', 'SAAZ-MUSIC CLUB'), ('SAMVAAD-THE-LITERATURE-AND-QUIZZING-SOCIETY', 'SAMVAAD-THE LITERATURE AND QUIZZING SOCIETY'), ('ABHIVYAKTI-ARTS-CLUB', 'ABHIVYAKTI-ARTS CLUB'), ('JAZBAAT-THE-DRAMATICS-SOCIETY', 'JAZBAAT-THE DRAMATICS SOCIETY'), ('AAVARTAN-DANCE-CLUB', 'AAVARTAN-DANCE CLUB'), ('BADMINTON-CLUB', 'BADMINTON CLUB'), ('LAWN-TENNIS-&-BASKETBALL-CLUB', 'LAWN TENNIS&BASKETBALL CLUB'), ('TABLE-TENNIS', 'TABLE TENNIS'), ('CHESS-&-CARROM-CLUB', 'CHESS & CARROM CLUB'), ('CRICKET-CLUB', 'CRICKET CLUB'), ('FOOTBALL-CLUB', 'FOOTBALL CLUB'), ('VOLLEYBALL-CLUB', 'VOLLEYBALL CLUB'), ('ATHLETICS-CLUB', 'ATHLETICS CLUB'), ('Business-Models-and-Strategies', 'Business Models and strategies'), ('Startups-and-Stratup-Strategies', 'Startups and Stratup Strategies'), ('Entrepreneurship', 'Entrepreneurship'), ('Finance', 'Finance'), ('Marketing', 'Marketing'), ('Stock-Market', 'Stock market'), ('Career-Advice', 'Career Advice'), ('Job-Interviews', 'Job Interviews'), ('Journalism', 'Journalism'), ('Entertainment', 'Entertainment'), ('Hollywood-and-Movies', 'Hollywood and Movies'), ('Music', 'Music'), ('Fashion-and-Style', 'Fashion and Style'), ('IIITDMJ-Campus', 'IIITDMJ-Campus'), ('Jabalpur-City', 'Jabalpur City'), ('IIITDMJ-rules-and-Regulations', 'IIITDMJ rules and regulations'), ('Academic-Office-Stuffs', 'Academic office stuffs'), ('Academic-Courses', 'Academic courses'), ('Central-Mess', 'Central Mess'), ('Alumni', 'Alumni'), ('Hostels', 'Hostels'), ('PHC', 'PHC'), ('Activities', 'Activities'), ('Counselling', 'Counselling'), ('Achievments', 'Achievments'), ('Library', 'Library'), ('Faculty', 'Faculty'), ('Staff', 'Staff'), ('College-Fest', 'College Fest'), ('Workshops', 'Workshops'), ('Campus-Recruitments', 'Campus Recruitments'), ('Jagrati', 'Jagrati'), ('Self-Improvement', 'Self Improvement'), ('Friendship', 'Friendship'), ('Experiences', 'Experiences'), ('Dating-and-Relationships', 'Dating and Relationships'), ('Interpersonal-Interactions', 'Interpersonal Interactions'), ('Life-and-Social-Advice', 'Life and Social Advice'), ('Philosophy', 'Philosophy'), ('Technology-Trends', 'Technology Trends'), ('TED', 'TED'), ('Higher-Education', 'Higher Education'), ('Science-and-Universe', 'Science and Universe'), ('Social-Media', 'Social-Media'), ('Toron', 'Toron'), ('Jobs-and-Internships', 'Jobs and Internships'), ('Btech', 'Btech'), ('Mtech', 'Mtech'), ('Bdes', 'Bdes'), ('Mdes', 'Mdes'), ('Phd', 'Phd'), ('Mechatronics', 'Mechatronics'), ('others', 'others')], default='Web-Development', max_length=100, unique=True)), - ], - ), - migrations.CreateModel( - name='AskaQuestion', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('can_delete', models.BooleanField(default=False)), - ('can_update', models.BooleanField(default=False)), - ('subject', models.CharField(max_length=100)), - ('description', models.CharField(blank=True, default='', max_length=500, null=True)), - ('file', models.FileField(blank=True, null=True, upload_to='feeds/files')), - ('uploaded_at', models.DateTimeField(default=django.utils.timezone.now)), - ('is_liked', models.BooleanField(default=False)), - ('is_requested', models.BooleanField(default=False)), - ('request', models.IntegerField(default=0)), - ('anonymous_ask', models.BooleanField(default=False)), - ('dislikes', models.ManyToManyField(blank=True, default=1, related_name='dislikes', to=settings.AUTH_USER_MODEL)), - ('likes', models.ManyToManyField(blank=True, default=1, related_name='likes', to=settings.AUTH_USER_MODEL)), - ('requests', models.ManyToManyField(blank=True, default=1, related_name='requests', to=settings.AUTH_USER_MODEL)), - ('select_tag', models.ManyToManyField(to='feeds.AllTags')), - ('user', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Comments', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('comment_text', models.CharField(max_length=5000)), - ('commented_at', models.DateTimeField(default=django.utils.timezone.now)), - ('is_liked', models.BooleanField(default=False)), - ('likes_comment', models.ManyToManyField(blank=True, default=1, related_name='likes_comment', to=settings.AUTH_USER_MODEL)), - ('question', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='feeds.askaquestion')), - ('user', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Roles', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('role', models.CharField(max_length=100)), - ('active', models.BooleanField(default=True)), - ('user', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='report', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('report_msg', models.CharField(default='', max_length=1000)), - ('question', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='feeds.askaquestion')), - ('user', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Reply', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('msg', models.CharField(max_length=1000)), - ('content', models.CharField(default='', max_length=5000)), - ('replied_at', models.DateTimeField(default=django.utils.timezone.now)), - ('comment', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='feeds.comments')), - ('replies', models.ManyToManyField(blank=True, default=1, related_name='replies', to=settings.AUTH_USER_MODEL)), - ('user', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='QuestionAccessControl', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('canVote', models.BooleanField()), - ('canAnswer', models.BooleanField()), - ('canComment', models.BooleanField()), - ('created_at', models.DateTimeField(default=django.utils.timezone.now)), - ('posted_by', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='feeds.roles')), - ('question', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='question_list', to='feeds.askaquestion')), - ], - ), - migrations.CreateModel( - name='Profile', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('bio', models.CharField(blank=True, max_length=250)), - ('profile_picture', models.ImageField(blank=True, null=True, upload_to='feeds/profile_pictures')), - ('profile_view', models.IntegerField(default=0)), - ('user', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='AnsweraQuestion', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('content', models.TextField(max_length=1000)), - ('uploaded_at', models.DateTimeField(default=django.utils.timezone.now)), - ('is_liked', models.BooleanField(default=False)), - ('answers', models.ManyToManyField(blank=True, default=1, related_name='answers', to=settings.AUTH_USER_MODEL)), - ('dislikes', models.ManyToManyField(blank=True, default=1, related_name='answer_dislikes', to=settings.AUTH_USER_MODEL)), - ('likes', models.ManyToManyField(blank=True, default=1, related_name='answer_likes', to=settings.AUTH_USER_MODEL)), - ('question', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='feeds.askaquestion')), - ('user', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='tags', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('my_tag', models.CharField(choices=[('CSE', 'CSE'), ('ECE', 'ECE'), ('Mechanical', 'Mechanical'), ('Technical-Clubs', 'Technical Clubs'), ('Cultural-Clubs', 'Cultural Clubs'), ('Sports-Clubs', 'Sports Clubs'), ('Business-and-Career', 'Business and Career'), ('Entertainment', 'Entertainment'), ('IIITDMJ-Campus', 'IIITDMJ Campus'), ('Jabalpur-city', 'Jabalpur city'), ('IIITDMJ-Rules-and-Regulations', 'IIITDMJ rules and regulations'), ('Academics', 'Academics'), ('IIITDMJ', 'IIITDMJ'), ('Life-Relationship-and-Self', 'Life Relationship and Self'), ('Technology-and-Education', 'Technology and Education'), ('Programmes', 'Programmes'), ('Others', 'Others'), ('Design', 'Design')], default=1, max_length=100)), - ('my_subtag', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='feeds.alltags')), - ('user', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - options={ - 'unique_together': {('user', 'my_subtag')}, - }, - ), - migrations.CreateModel( - name='hidden', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('question', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='feeds.askaquestion')), - ('user', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - options={ - 'unique_together': {('user', 'question')}, - }, - ), - ] diff --git a/FusionIIIT/applications/feeds/migrations/__init__.py b/FusionIIIT/applications/feeds/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/filetracking/.DS_Store b/FusionIIIT/applications/filetracking/.DS_Store new file mode 100644 index 000000000..ffb7c822f Binary files /dev/null and b/FusionIIIT/applications/filetracking/.DS_Store differ diff --git a/FusionIIIT/applications/filetracking/migrations/0001_initial.py b/FusionIIIT/applications/filetracking/migrations/0001_initial.py deleted file mode 100644 index 6924ae1ff..000000000 --- a/FusionIIIT/applications/filetracking/migrations/0001_initial.py +++ /dev/null @@ -1,53 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('globals', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='File', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('subject', models.CharField(blank=True, max_length=100, null=True)), - ('description', models.CharField(blank=True, max_length=400, null=True)), - ('upload_date', models.DateTimeField(auto_now_add=True)), - ('upload_file', models.FileField(blank=True, upload_to='')), - ('is_read', models.BooleanField(default=False)), - ('designation', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='upload_designation', to='globals.designation')), - ('uploader', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='uploaded_files', to='globals.extrainfo')), - ], - options={ - 'db_table': 'File', - }, - ), - migrations.CreateModel( - name='Tracking', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('receive_date', models.DateTimeField(auto_now_add=True)), - ('forward_date', models.DateTimeField(auto_now_add=True)), - ('remarks', models.CharField(blank=True, max_length=250, null=True)), - ('upload_file', models.FileField(blank=True, upload_to='')), - ('is_read', models.BooleanField(default=False)), - ('current_design', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='globals.holdsdesignation')), - ('current_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ('file_id', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='filetracking.file')), - ('receive_design', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='rec_design', to='globals.designation')), - ('receiver_id', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='receiver_id', to=settings.AUTH_USER_MODEL)), - ], - options={ - 'db_table': 'Tracking', - }, - ), - ] diff --git a/FusionIIIT/applications/filetracking/migrations/__init__.py b/FusionIIIT/applications/filetracking/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/finance_accounts/.DS_Store b/FusionIIIT/applications/finance_accounts/.DS_Store new file mode 100644 index 000000000..505e652f3 Binary files /dev/null and b/FusionIIIT/applications/finance_accounts/.DS_Store differ diff --git a/FusionIIIT/applications/finance_accounts/migrations/0001_initial.py b/FusionIIIT/applications/finance_accounts/migrations/0001_initial.py deleted file mode 100644 index 4dfa8fed7..000000000 --- a/FusionIIIT/applications/finance_accounts/migrations/0001_initial.py +++ /dev/null @@ -1,100 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='Bank', - fields=[ - ('bank_id', models.AutoField(primary_key=True, serialize=False)), - ('Account_no', models.IntegerField(default=0, unique=True)), - ('Bank_Name', models.CharField(max_length=50)), - ('IFSC_Code', models.CharField(max_length=20, unique=True)), - ('Branch_Name', models.CharField(max_length=80)), - ], - ), - migrations.CreateModel( - name='Company', - fields=[ - ('company_id', models.AutoField(primary_key=True, serialize=False)), - ('Company_Name', models.CharField(max_length=20, unique=True)), - ('Start_Date', models.DateField()), - ('End_Date', models.DateField(blank=True, null=True)), - ('Description', models.CharField(max_length=200)), - ('Status', models.CharField(max_length=200)), - ], - ), - migrations.CreateModel( - name='Payments', - fields=[ - ('payment_id', models.AutoField(primary_key=True, serialize=False)), - ('TransactionId', models.IntegerField(default=0, unique=True)), - ('ToWhom', models.CharField(max_length=80)), - ('FromWhom', models.CharField(max_length=80)), - ('Purpose', models.CharField(max_length=20)), - ('Date', models.DateField()), - ], - ), - migrations.CreateModel( - name='Paymentscheme', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('month', models.CharField(max_length=70, null=True)), - ('year', models.IntegerField(null=True)), - ('pf', models.IntegerField(null=True)), - ('name', models.CharField(max_length=70)), - ('designation', models.CharField(max_length=50)), - ('pay', models.IntegerField()), - ('gr_pay', models.IntegerField()), - ('da', models.IntegerField()), - ('ta', models.IntegerField()), - ('hra', models.IntegerField()), - ('fpa', models.IntegerField()), - ('special_allow', models.IntegerField()), - ('nps', models.IntegerField()), - ('gpf', models.IntegerField()), - ('income_tax', models.IntegerField()), - ('p_tax', models.IntegerField()), - ('gslis', models.IntegerField()), - ('gis', models.IntegerField()), - ('license_fee', models.IntegerField()), - ('electricity_charges', models.IntegerField()), - ('others', models.IntegerField()), - ('gr_reduction', models.IntegerField(default=0)), - ('net_payment', models.IntegerField(default=0)), - ('senior_verify', models.BooleanField(default=False)), - ('ass_registrar_verify', models.BooleanField(default=False)), - ('ass_registrar_aud_verify', models.BooleanField(default=False)), - ('registrar_director_verify', models.BooleanField(default=False)), - ('runpayroll', models.BooleanField(default=False)), - ('view', models.BooleanField(default=True)), - ], - ), - migrations.CreateModel( - name='Receipts', - fields=[ - ('receipt_id', models.AutoField(primary_key=True, serialize=False)), - ('TransactionId', models.IntegerField(default=0, unique=True)), - ('ToWhom', models.CharField(max_length=80)), - ('FromWhom', models.CharField(max_length=80)), - ('Purpose', models.CharField(max_length=20)), - ('Date', models.DateField()), - ], - ), - migrations.AddConstraint( - model_name='paymentscheme', - constraint=models.UniqueConstraint(fields=('month', 'year', 'pf'), name='Unique Contraint 1'), - ), - migrations.AddConstraint( - model_name='bank', - constraint=models.UniqueConstraint(fields=('Bank_Name', 'Branch_Name'), name='Unique Contraint 2'), - ), - ] diff --git a/FusionIIIT/applications/finance_accounts/migrations/__init__.py b/FusionIIIT/applications/finance_accounts/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/globals/.DS_Store b/FusionIIIT/applications/globals/.DS_Store new file mode 100644 index 000000000..970c2a968 Binary files /dev/null and b/FusionIIIT/applications/globals/.DS_Store differ diff --git a/FusionIIIT/applications/globals/migrations/0001_initial.py b/FusionIIIT/applications/globals/migrations/0001_initial.py deleted file mode 100644 index 1fc3a8925..000000000 --- a/FusionIIIT/applications/globals/migrations/0001_initial.py +++ /dev/null @@ -1,112 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -import applications.globals.models -import datetime -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.CreateModel( - name='DepartmentInfo', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=100, unique=True)), - ], - ), - migrations.CreateModel( - name='Designation', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(default='student', max_length=50, unique=True)), - ('full_name', models.CharField(default='Computer Science and Engineering', max_length=100)), - ('type', models.CharField(choices=[('academic', 'Academic Designation'), ('administrative', 'Administrative Designation')], default='academic', max_length=30)), - ], - ), - migrations.CreateModel( - name='ExtraInfo', - fields=[ - ('id', models.CharField(max_length=20, primary_key=True, serialize=False)), - ('title', models.CharField(choices=[('Mr.', 'Mr.'), ('Mrs.', 'Mrs.'), ('Ms.', 'Ms.'), ('Dr.', 'Dr.'), ('Professor', 'Prof.'), ('Shreemati', 'Shreemati'), ('Shree', 'Shree')], default='Dr.', max_length=20)), - ('sex', models.CharField(choices=[('M', 'Male'), ('F', 'Female'), ('O', 'Other')], default='M', max_length=2)), - ('date_of_birth', models.DateField(default=datetime.date(1970, 1, 1))), - ('user_status', models.CharField(choices=[('PRESENT', 'PRESENT'), ('NEW', 'NEW')], default='PRESENT', max_length=50)), - ('address', models.TextField(default='', max_length=1000)), - ('phone_no', models.BigIntegerField(default=9999999999, null=True)), - ('user_type', models.CharField(choices=[('student', 'student'), ('staff', 'staff'), ('compounder', 'compounder'), ('faculty', 'faculty')], max_length=20)), - ('profile_picture', models.ImageField(blank=True, null=True, upload_to='globals/profile_pictures')), - ('about_me', models.TextField(blank=True, default='NA', max_length=1000)), - ('date_modified', models.DateTimeField(blank=True, null=True, verbose_name='date_updated')), - ('department', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='globals.departmentinfo')), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Faculty', - fields=[ - ('id', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='Staff', - fields=[ - ('id', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='IssueImage', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('image', models.ImageField(upload_to=applications.globals.models.Issue_image_directory)), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Issue', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('report_type', models.CharField(choices=[('feature_request', 'Feature Request'), ('bug_report', 'Bug Report'), ('security_issue', 'Security Issue'), ('ui_issue', 'User Interface Issue'), ('other', 'Other than the ones listed')], max_length=63)), - ('module', models.CharField(choices=[('academic_information', 'Academic'), ('central_mess', 'Central Mess'), ('complaint_system', 'Complaint System'), ('eis', 'Employee Imformation System'), ('file_tracking', 'File Tracking System'), ('health_center', 'Health Center'), ('leave', 'Leave'), ('online_cms', 'Online Course Management System'), ('placement_cell', 'Placement Cell'), ('scholarships', 'Scholarships'), ('visitor_hostel', 'Visitor Hostel'), ('other', 'Other')], max_length=63)), - ('closed', models.BooleanField(default=False)), - ('text', models.TextField()), - ('title', models.CharField(max_length=255)), - ('timestamp', models.DateTimeField(auto_now=True)), - ('added_on', models.DateTimeField(auto_now_add=True)), - ('images', models.ManyToManyField(blank=True, to='globals.IssueImage')), - ('support', models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL)), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reported_issues', to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Feedback', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('rating', models.IntegerField(choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])), - ('feedback', models.TextField(blank=True)), - ('timestamp', models.DateTimeField(auto_now=True)), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='fusion_feedback', to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='HoldsDesignation', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('held_at', models.DateTimeField(auto_now=True)), - ('designation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='designees', to='globals.designation')), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='holds_designations', to=settings.AUTH_USER_MODEL)), - ('working', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='current_designation', to=settings.AUTH_USER_MODEL)), - ], - options={ - 'unique_together': {('user', 'designation'), ('working', 'designation')}, - }, - ), - ] diff --git a/FusionIIIT/applications/globals/migrations/__init__.py b/FusionIIIT/applications/globals/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/globals/urls.py b/FusionIIIT/applications/globals/urls.py index f8d82ee71..2dea4e77d 100644 --- a/FusionIIIT/applications/globals/urls.py +++ b/FusionIIIT/applications/globals/urls.py @@ -23,5 +23,6 @@ # Endpoint to reset all passwords in DEV environment url(r'^resetallpass/$', views.reset_all_pass, name='resetallpass'), # API urls - url(r'^api/', include('applications.globals.api.urls')) + url(r'^api/', include('applications.globals.api.urls')), + url(r'^update_global_variable/$', views.update_global_variable, name='update_global_var'), ] diff --git a/FusionIIIT/applications/globals/views.py b/FusionIIIT/applications/globals/views.py index a7f3886c9..91bba456f 100644 --- a/FusionIIIT/applications/globals/views.py +++ b/FusionIIIT/applications/globals/views.py @@ -28,6 +28,7 @@ from Fusion.settings.common import LOGIN_URL from notifications.models import Notification from .models import * +from applications.hostel_management.models import (HallCaretaker,HallWarden) def index(request): context = {} @@ -732,29 +733,48 @@ def dashboard(request): for i in b : name_ = get_object_or_404(Designation, id = i) roll_.append(str(name_.name)) + + hall_caretakers = HallCaretaker.objects.all().select_related() + hall_wardens = HallWarden.objects.all().select_related() + + hall_caretaker_user = [] + for caretaker in hall_caretakers: + hall_caretaker_user.append(caretaker.staff.id.user) + + hall_warden_user = [] + for warden in hall_wardens: + hall_warden_user.append(warden.faculty.id.user) + context={ 'notifications':notifs, 'Curr_desig' : roll_, 'club_details' : coordinator_club(request), 'designation' : designation, + 'hall_caretaker': hall_caretaker_user, + 'hall_warden': hall_warden_user, } # a=HoldsDesignation.objects.select_related('user','working','designation').filter(designation = user) + print(context) + print(type(user.extrainfo.user_type)) if(request.user.get_username() == 'director'): return render(request, "dashboard/director_dashboard2.html", {}) elif( "dean_rspc" in designation): return render(request, "dashboard/dashboard.html", context) - elif user.extrainfo.user_type != 'student': + elif user.extrainfo.user_type != "student": + print ("inside") designat = HoldsDesignation.objects.select_related().filter(user=user) response = {'designat':designat} context.update(response) return render(request, "dashboard/dashboard.html", context) else: + print ("inside2") + return render(request, "dashboard/dashboard.html", context) @login_required(login_url=LOGIN_URL) -def profile(request, username=None): +def profile(request, username=None): """ Generic endpoint for views. If it's a faculty, redirects to /eis/profile/* @@ -768,16 +788,76 @@ def profile(request, username=None): """ user = get_object_or_404(User, Q(username=username)) if username else request.user - editable = request.user == user + print("editable",editable) profile = get_object_or_404(ExtraInfo, Q(user=user)) + print("profile",profile) if(str(user.extrainfo.user_type)=='faculty'): + print("profile") return HttpResponseRedirect('/eis/profile/' + (username if username else '')) if(str(user.extrainfo.department)=='department: Academics'): + print("profile2") return HttpResponseRedirect('/aims') - current = HoldsDesignation.objects.select_related('user','working','designation').filter(Q(working=user, designation__name="student")) + + array = [ + "student", + "CC convenor", + "Mechatronic convenor", + "mess_committee", + "mess_convener", + "alumini", + "Electrical_AE", + "Electrical_JE", + "Civil_AE", + "Civil_JE", + "co-ordinator", + "co co-ordinator", + "Convenor", + "Convener", + "cc1convener", + "CC2 convener", + "mess_convener_mess2", + "mess_committee_mess2" +] + + # queryset = HoldsDesignation.objects.select_related('user','working','designation').filter(Q(working=user)) + + # for obj in queryset: + # designation_name = obj.designation.name + # print("designation_name",designation_name) + + # design = False + # if designation_name in array: + # design = True + # print("design",design) + # print("designation_name",designation_name) + # if design: + # current = HoldsDesignation.objects.select_relapted('user','working','designation').filter(Q(working=user, designation__name=designation_name)) + # for obj in current: + # obj.designation.name = obj.designation.name.replace(designation_name, 'student') + + designation_name = "" + design = False + + current = HoldsDesignation.objects.select_related('user', 'working', 'designation').filter(Q(working=user)) + + for obj in current: + designation_name = obj.designation.name + if designation_name in array: + design = True + break + + if design: + current = HoldsDesignation.objects.filter(working=user, designation__name=designation_name) + for obj in current: + obj.designation.name = obj.designation.name.replace(designation_name, 'student') + + print(user.extrainfo.user_type) + print("current",current) if current: + print("profile3") student = get_object_or_404(Student, Q(id=profile.id)) + print("student",student) if editable and request.method == 'POST': if 'studentapprovesubmit' in request.POST: status = PlacementStatus.objects.select_related('notify_id','unique_id__id__user','unique_id__id__department').filter(pk=request.POST['studentapprovesubmit']).update(invitation='ACCEPTED', timestamp=timezone.now()) @@ -979,6 +1059,7 @@ def profile(request, username=None): return render(request, "globals/student_profile4.html", context) if 'achievementsubmit' in request.POST or 'deleteach' in request.POST: return render(request, "globals/student_profile5.html", context) + print("context",context) return render(request, "globals/student_profile.html", context) else: return redirect("/") @@ -1176,4 +1257,15 @@ def search(request): if len(search_results) == 0: search_results = [] context = {'sresults':search_results} - return render(request, "globals/search.html", context) + return render(request, "globals/search.html", context), + +@login_required(login_url=LOGIN_URL) +def update_global_variable(request): + if request.method == 'POST': + selected_option = request.POST.get('dropdown') + request.session['currentDesignationSelected'] = selected_option + print(selected_option) + print(request.session['currentDesignationSelected']) + return HttpResponseRedirect(request.META.get('HTTP_REFERER', '/')) + # Redirect to home if not a POST request or some issue occurs + return HttpResponseRedirect(reverse('home')) diff --git a/FusionIIIT/applications/gymkhana/.DS_Store b/FusionIIIT/applications/gymkhana/.DS_Store new file mode 100644 index 000000000..115f79077 Binary files /dev/null and b/FusionIIIT/applications/gymkhana/.DS_Store differ diff --git a/FusionIIIT/applications/gymkhana/migrations/0001_initial.py b/FusionIIIT/applications/gymkhana/migrations/0001_initial.py deleted file mode 100644 index e140005a1..000000000 --- a/FusionIIIT/applications/gymkhana/migrations/0001_initial.py +++ /dev/null @@ -1,243 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import django.utils.timezone - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('academic_information', '0001_initial'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('globals', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Club_info', - fields=[ - ('club_name', models.CharField(max_length=50, primary_key=True, serialize=False)), - ('club_website', models.CharField(default='hello', max_length=150, null=True)), - ('category', models.CharField(choices=[('Technical', 'Technical'), ('Sports', 'Sports'), ('Cultural', 'Cultural')], max_length=50)), - ('club_file', models.FileField(null=True, upload_to='gymkhana/club_poster')), - ('activity_calender', models.FileField(default=' ', null=True, upload_to='gymkhana/activity_calender')), - ('description', models.TextField(max_length=256, null=True)), - ('alloted_budget', models.IntegerField(default=0, null=True)), - ('spent_budget', models.IntegerField(default=0, null=True)), - ('avail_budget', models.IntegerField(default=0, null=True)), - ('status', models.CharField(choices=[('open', 'Open'), ('confirmed', 'Confirmed'), ('rejected', 'Rejected')], default='open', max_length=50)), - ('co_coordinator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='coco_of', to='academic_information.student')), - ('co_ordinator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='co_of', to='academic_information.student')), - ('faculty_incharge', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='faculty_incharge_of', to='globals.faculty')), - ], - options={ - 'db_table': 'Club_info', - }, - ), - migrations.CreateModel( - name='Fest_budget', - fields=[ - ('id', models.AutoField(primary_key=True, serialize=False)), - ('fest', models.CharField(choices=[('Abhikalpan', 'Abhikalpan'), ('Gusto', 'Gusto'), ('Tarang', 'Tarang')], max_length=50)), - ('budget_amt', models.IntegerField(default=0)), - ('budget_file', models.FileField(upload_to='uploads/')), - ('year', models.CharField(max_length=10, null=True)), - ('description', models.TextField(max_length=256)), - ('status', models.CharField(choices=[('open', 'Open'), ('confirmed', 'Confirmed'), ('rejected', 'Rejected')], default='open', max_length=50)), - ('remarks', models.CharField(max_length=256, null=True)), - ], - options={ - 'db_table': 'Fest_budget', - }, - ), - migrations.CreateModel( - name='Form_available', - fields=[ - ('roll', models.CharField(default=2016001, max_length=7, primary_key=True, serialize=False)), - ('status', models.BooleanField(default=True, max_length=5)), - ('form_name', models.CharField(default='senate_registration', max_length=30)), - ], - options={ - 'db_table': 'Form_available', - }, - ), - migrations.CreateModel( - name='Registration_form', - fields=[ - ('roll', models.CharField(default='2016001', max_length=7, primary_key=True, serialize=False)), - ('user_name', models.CharField(default='Student', max_length=40)), - ('branch', models.CharField(default='open', max_length=20)), - ('cpi', models.FloatField(default=6.0, max_length=3)), - ('programme', models.CharField(default='B.tech', max_length=20)), - ], - options={ - 'db_table': 'Registration_form', - }, - ), - migrations.CreateModel( - name='Voting_polls', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('title', models.CharField(max_length=200)), - ('description', models.CharField(max_length=5000)), - ('pub_date', models.DateTimeField(default=django.utils.timezone.now)), - ('exp_date', models.DateTimeField(default=django.utils.timezone.now)), - ('created_by', models.CharField(max_length=100, null=True)), - ('groups', models.CharField(default='{}', max_length=500)), - ], - options={ - 'ordering': ['-pub_date'], - }, - ), - migrations.CreateModel( - name='Voting_voters', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('student_id', models.CharField(max_length=50)), - ('poll_event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='gymkhana.voting_polls')), - ], - ), - migrations.CreateModel( - name='Voting_choices', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('title', models.CharField(max_length=200)), - ('description', models.CharField(default='', max_length=500)), - ('votes', models.IntegerField(default=0)), - ('poll_event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='gymkhana.voting_polls')), - ], - options={ - 'get_latest_by': 'votes', - }, - ), - migrations.CreateModel( - name='Session_info', - fields=[ - ('id', models.AutoField(primary_key=True, serialize=False)), - ('venue', models.CharField(choices=[('Classroom', (('CR101', 'CR101'), ('CR102', 'CR102'))), ('Lecturehall', (('L101', 'L101'), ('L102', 'L102')))], max_length=50)), - ('date', models.DateField(default=None)), - ('start_time', models.TimeField(default=None)), - ('end_time', models.TimeField(default=None, null=True)), - ('session_poster', models.ImageField(null=True, upload_to='gymkhana/session_poster')), - ('details', models.TextField(max_length=256, null=True)), - ('status', models.CharField(choices=[('open', 'Open'), ('confirmed', 'Confirmed'), ('rejected', 'Rejected')], default='open', max_length=50)), - ('club', models.ForeignKey(max_length=50, null=True, on_delete=django.db.models.deletion.CASCADE, to='gymkhana.club_info')), - ], - options={ - 'db_table': 'Session_info', - }, - ), - migrations.CreateModel( - name='Other_report', - fields=[ - ('id', models.AutoField(primary_key=True, serialize=False)), - ('event_name', models.CharField(max_length=50)), - ('date', models.DateTimeField(blank=True, default=django.utils.timezone.now, max_length=50)), - ('event_details', models.FileField(upload_to='uploads/')), - ('description', models.TextField(max_length=256, null=True)), - ('incharge', models.ForeignKey(max_length=256, on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - options={ - 'db_table': 'Other_report', - }, - ), - migrations.CreateModel( - name='Event_info', - fields=[ - ('id', models.AutoField(primary_key=True, serialize=False)), - ('event_name', models.CharField(max_length=256)), - ('venue', models.CharField(choices=[('Classroom', (('CR101', 'CR101'), ('CR102', 'CR102'))), ('Lecturehall', (('L101', 'L101'), ('L102', 'L102')))], max_length=50)), - ('incharge', models.CharField(max_length=256)), - ('date', models.DateField(default=None)), - ('start_time', models.TimeField(default=None)), - ('end_time', models.TimeField(default=None, null=True)), - ('event_poster', models.FileField(blank=True, upload_to='gymkhana/event_poster')), - ('details', models.TextField(max_length=256, null=True)), - ('status', models.CharField(choices=[('open', 'Open'), ('confirmed', 'Confirmed'), ('rejected', 'Rejected')], default='open', max_length=50)), - ('club', models.ForeignKey(max_length=50, null=True, on_delete=django.db.models.deletion.CASCADE, to='gymkhana.club_info')), - ], - options={ - 'db_table': 'Event_info', - }, - ), - migrations.CreateModel( - name='Core_team', - fields=[ - ('id', models.AutoField(primary_key=True, serialize=False)), - ('team', models.CharField(max_length=50)), - ('year', models.DateTimeField(max_length=6, null=True)), - ('fest_name', models.CharField(choices=[('Abhikalpan', 'Abhikalpan'), ('Gusto', 'Gusto'), ('Tarang', 'Tarang')], max_length=256)), - ('pda', models.TextField(max_length=256)), - ('remarks', models.CharField(max_length=256, null=True)), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='applied_for', to='academic_information.student')), - ], - options={ - 'db_table': 'Core_team', - }, - ), - migrations.CreateModel( - name='Club_report', - fields=[ - ('id', models.AutoField(primary_key=True, serialize=False)), - ('event_name', models.CharField(max_length=50)), - ('date', models.DateTimeField(blank=True, default=django.utils.timezone.now, max_length=50)), - ('event_details', models.FileField(upload_to='uploads/')), - ('description', models.TextField(max_length=256, null=True)), - ('club', models.ForeignKey(max_length=50, on_delete=django.db.models.deletion.CASCADE, to='gymkhana.club_info')), - ('incharge', models.ForeignKey(max_length=256, on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - options={ - 'db_table': 'Club_report', - }, - ), - migrations.CreateModel( - name='Club_member', - fields=[ - ('id', models.AutoField(primary_key=True, serialize=False)), - ('description', models.TextField(max_length=256, null=True)), - ('status', models.CharField(choices=[('open', 'Open'), ('confirmed', 'Confirmed'), ('rejected', 'Rejected')], default='open', max_length=50)), - ('remarks', models.CharField(max_length=256, null=True)), - ('club', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='this_club', to='gymkhana.club_info')), - ('member', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='member_of', to='academic_information.student')), - ], - options={ - 'db_table': 'Club_member', - }, - ), - migrations.CreateModel( - name='Club_budget', - fields=[ - ('id', models.AutoField(primary_key=True, serialize=False)), - ('budget_for', models.CharField(max_length=256)), - ('budget_amt', models.IntegerField(default=0)), - ('budget_file', models.FileField(upload_to='uploads/')), - ('description', models.TextField(max_length=256)), - ('status', models.CharField(choices=[('open', 'Open'), ('confirmed', 'Confirmed'), ('rejected', 'Rejected')], default='open', max_length=50)), - ('remarks', models.CharField(max_length=256, null=True)), - ('club', models.ForeignKey(max_length=50, on_delete=django.db.models.deletion.CASCADE, to='gymkhana.club_info')), - ], - options={ - 'db_table': 'Club_budget', - }, - ), - migrations.CreateModel( - name='Change_office', - fields=[ - ('id', models.AutoField(primary_key=True, serialize=False)), - ('status', models.CharField(choices=[('open', 'Open'), ('confirmed', 'Confirmed'), ('rejected', 'Rejected')], default='open', max_length=50)), - ('date_request', models.DateTimeField(blank=True, default=django.utils.timezone.now, max_length=50)), - ('date_approve', models.DateTimeField(blank=True, max_length=50)), - ('remarks', models.CharField(max_length=256, null=True)), - ('club', models.ForeignKey(max_length=50, on_delete=django.db.models.deletion.CASCADE, to='gymkhana.club_info')), - ('co_coordinator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='coco_of', to=settings.AUTH_USER_MODEL)), - ('co_ordinator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='co_of', to=settings.AUTH_USER_MODEL)), - ], - options={ - 'db_table': 'Change_office', - }, - ), - ] diff --git a/FusionIIIT/applications/gymkhana/migrations/__init__.py b/FusionIIIT/applications/gymkhana/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/health_center/.DS_Store b/FusionIIIT/applications/health_center/.DS_Store new file mode 100644 index 000000000..1a5fcadf8 Binary files /dev/null and b/FusionIIIT/applications/health_center/.DS_Store differ diff --git a/FusionIIIT/applications/health_center/migrations/0001_initial.py b/FusionIIIT/applications/health_center/migrations/0001_initial.py deleted file mode 100644 index ee068099e..000000000 --- a/FusionIIIT/applications/health_center/migrations/0001_initial.py +++ /dev/null @@ -1,168 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('globals', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Appointment', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('description', models.CharField(max_length=50)), - ('date', models.DateField()), - ], - ), - migrations.CreateModel( - name='Counter', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('count', models.IntegerField(default=0)), - ('fine', models.IntegerField(default=0)), - ('doc_count', models.IntegerField(default=0)), - ], - ), - migrations.CreateModel( - name='Doctor', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('doctor_name', models.IntegerField(choices=[(0, 'Dr.Sharma'), (1, 'Dr.Vinay')])), - ('doctor_phone', models.CharField(max_length=10)), - ('specialization', models.CharField(max_length=100)), - ('active', models.BooleanField(default=True)), - ], - ), - migrations.CreateModel( - name='Hospital', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('hospital_name', models.CharField(max_length=100)), - ('phone', models.CharField(max_length=10)), - ], - ), - migrations.CreateModel( - name='Stock', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('medicine_name', models.CharField(max_length=100)), - ('quantity', models.IntegerField(default=0)), - ('threshold', models.IntegerField(default=10)), - ], - ), - migrations.CreateModel( - name='Schedule', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('day', models.IntegerField(choices=[(0, 'Monday'), (1, 'Tuesday'), (2, 'Wednesday'), (3, 'Thursday'), (4, 'Friday'), (5, 'Saturday'), (6, 'Sunday')])), - ('from_time', models.TimeField(blank=True, null=True)), - ('to_time', models.TimeField(blank=True, null=True)), - ('room', models.IntegerField()), - ('date', models.DateField(auto_now=True)), - ('doctor_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='health_center.doctor')), - ], - ), - migrations.CreateModel( - name='Prescription', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('details', models.CharField(max_length=100)), - ('date', models.DateField()), - ('test', models.CharField(blank=True, max_length=200, null=True)), - ('appointment', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='health_center.appointment')), - ('doctor_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='health_center.doctor')), - ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='Prescribed_medicine', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('quantity', models.IntegerField(default=0)), - ('days', models.IntegerField(default=0)), - ('times', models.IntegerField(default=0)), - ('medicine_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='health_center.stock')), - ('prescription_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='health_center.prescription')), - ], - ), - migrations.CreateModel( - name='Medicine', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('quantity', models.IntegerField(default=0)), - ('days', models.IntegerField(default=0)), - ('times', models.IntegerField(default=0)), - ('medicine_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='health_center.stock')), - ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='Hospital_admit', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('hospital_doctor', models.CharField(max_length=100)), - ('admission_date', models.DateField()), - ('discharge_date', models.DateField(blank=True, null=True)), - ('reason', models.CharField(max_length=50)), - ('doctor_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='health_center.doctor')), - ('hospital_name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='health_center.hospital')), - ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='Expiry', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('quantity', models.IntegerField(default=0)), - ('supplier', models.CharField(max_length=50)), - ('expiry_date', models.DateField()), - ('returned', models.BooleanField(default=False)), - ('return_date', models.DateField(blank=True, null=True)), - ('date', models.DateField(auto_now=True)), - ('medicine_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='health_center.stock')), - ], - ), - migrations.CreateModel( - name='Complaint', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('feedback', models.CharField(max_length=100, null=True)), - ('complaint', models.CharField(max_length=100, null=True)), - ('date', models.DateField(auto_now=True)), - ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - migrations.AddField( - model_name='appointment', - name='doctor_id', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='health_center.doctor'), - ), - migrations.AddField( - model_name='appointment', - name='schedule', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='health_center.schedule'), - ), - migrations.AddField( - model_name='appointment', - name='user_id', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo'), - ), - migrations.CreateModel( - name='Ambulance_request', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date_request', models.DateTimeField()), - ('start_date', models.DateField()), - ('end_date', models.DateField(blank=True, null=True)), - ('reason', models.CharField(max_length=50)), - ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - ] diff --git a/FusionIIIT/applications/health_center/migrations/__init__.py b/FusionIIIT/applications/health_center/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/hostel_management/.DS_Store b/FusionIIIT/applications/hostel_management/.DS_Store new file mode 100644 index 000000000..d74680401 Binary files /dev/null and b/FusionIIIT/applications/hostel_management/.DS_Store differ diff --git a/FusionIIIT/applications/hostel_management/admin.py b/FusionIIIT/applications/hostel_management/admin.py index 0ab767ac1..8e8917269 100644 --- a/FusionIIIT/applications/hostel_management/admin.py +++ b/FusionIIIT/applications/hostel_management/admin.py @@ -5,10 +5,20 @@ admin.site.register(Hall) admin.site.register(HallCaretaker) admin.site.register(HallWarden) -admin.site.register(GuestRoomDetail) + admin.site.register(GuestRoomBooking) admin.site.register(StaffSchedule) admin.site.register(HostelNoticeBoard) admin.site.register(HostelStudentAttendence) admin.site.register(HallRoom) -admin.site.register(WorkerReport) \ No newline at end of file +admin.site.register(WorkerReport) +admin.site.register(HostelInventory) +admin.site.register(HostelFine) +admin.site.register(HostelLeave) +admin.site.register(HostelComplaint) +admin.site.register(StudentDetails) +admin.site.register(HostelAllotment) +admin.site.register(GuestRoom) +admin.site.register(HostelTransactionHistory) +admin.site.register(HostelHistory) + diff --git a/FusionIIIT/applications/hostel_management/forms.py b/FusionIIIT/applications/hostel_management/forms.py index a727bd069..b1772bdf9 100644 --- a/FusionIIIT/applications/hostel_management/forms.py +++ b/FusionIIIT/applications/hostel_management/forms.py @@ -1,9 +1,33 @@ from django import forms -from .models import HostelNoticeBoard, Hall +from .models import HostelNoticeBoard, Hall, GuestRoomBooking class HostelNoticeBoardForm(forms.ModelForm): class Meta: model = HostelNoticeBoard fields = ('hall', 'head_line', 'content', 'description') - \ No newline at end of file + + +class HallForm(forms.ModelForm): + class Meta: + model = Hall + fields = ['hall_id', 'hall_name', 'max_accomodation', 'assigned_batch','type_of_seater'] + +class GuestRoomBookingForm(forms.ModelForm): + class Meta: + model = GuestRoomBooking + fields = ( + 'hall', + 'guest_name', + 'guest_phone', + 'guest_email', + 'guest_address', + 'rooms_required', + 'total_guest', + 'purpose', + 'arrival_date', + 'arrival_time', + 'departure_date', + 'departure_time', + 'nationality' + ) \ No newline at end of file diff --git a/FusionIIIT/applications/hostel_management/management/commands/copy_data.py b/FusionIIIT/applications/hostel_management/management/commands/copy_data.py new file mode 100644 index 000000000..370583025 --- /dev/null +++ b/FusionIIIT/applications/hostel_management/management/commands/copy_data.py @@ -0,0 +1,36 @@ +from applications.academic_information.models import Student +from applications.hostel_management.models import StudentDetails +from django.contrib.auth.models import User + + +def copy_data(): + + # Fetch data from the Student table with a join to the User table + student_data = Student.objects.all() + + # Iterate over the student data and create StudentDetails instances + for student_instance in student_data: + # Extract data from the related User instance + id = student_instance.id_id + user_instance = User.objects.filter(username=id).first(); + user_instance = User.objects.get(username=id) + + # Create a StudentDetails instance using data from the Student and User instances + student_details_instance = StudentDetails( + id=student_instance.id_id, + first_name=user_instance.first_name, + last_name=user_instance.last_name, + programme=student_instance.programme, + batch=student_instance.batch, + room_num=student_instance.room_no, + hall_no=student_instance.hall_no, + specialization=student_instance.specialization, + # parent_contact=student_instance.parent_contact, + # address=student_instance.address + ) + + # Save the StudentDetails instance to the database + student_details_instance.save() + +# Call the function to initiate the data copying process +copy_data() diff --git a/FusionIIIT/applications/hostel_management/migrations/0001_initial.py b/FusionIIIT/applications/hostel_management/migrations/0001_initial.py deleted file mode 100644 index ef1639d4c..000000000 --- a/FusionIIIT/applications/hostel_management/migrations/0001_initial.py +++ /dev/null @@ -1,137 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import django.db.models.fields.related -import django.utils.timezone - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('academic_information', '0001_initial'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('globals', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Hall', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('hall_id', models.CharField(max_length=10)), - ('hall_name', models.CharField(max_length=50)), - ('max_accomodation', models.IntegerField(default=0)), - ('number_students', models.PositiveIntegerField(default=0)), - ], - ), - migrations.CreateModel( - name='WorkerReport', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('worker_id', models.CharField(max_length=10)), - ('worker_name', models.CharField(max_length=50)), - ('year', models.IntegerField(default=2020)), - ('month', models.IntegerField(default=1)), - ('absent', models.IntegerField(default=0)), - ('total_day', models.IntegerField(default=31)), - ('remark', models.CharField(max_length=100)), - ('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')), - ], - ), - migrations.CreateModel( - name='StaffSchedule', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('staff_type', models.CharField(default='Caretaker', max_length=100)), - ('day', models.CharField(choices=[('Monday', 'Monday'), ('Tuesday', 'Tuesday'), ('Wednesday', 'Wednesday'), ('Thursday', 'Thursday'), ('Friday', 'Friday'), ('Saturday', 'Saturday'), ('Sunday', 'Sunday')], max_length=15)), - ('start_time', models.TimeField(blank=True, null=True)), - ('end_time', models.TimeField(blank=True, null=True)), - ('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')), - ('staff_id', models.ForeignKey(on_delete=django.db.models.fields.related.ForeignKey, to='globals.staff')), - ], - ), - migrations.CreateModel( - name='HostelStudentAttendence', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date', models.DateField()), - ('present', models.BooleanField()), - ('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='HostelNoticeBoard', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('head_line', models.CharField(max_length=100)), - ('content', models.FileField(blank=True, null=True, upload_to='hostel_management/')), - ('description', models.TextField(blank=True)), - ('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')), - ('posted_by', models.ForeignKey(on_delete=django.db.models.fields.related.ForeignKey, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='HallWarden', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('faculty', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.faculty')), - ('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')), - ], - ), - migrations.CreateModel( - name='HallRoom', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('room_no', models.CharField(max_length=4)), - ('block_no', models.CharField(max_length=1)), - ('room_cap', models.IntegerField(default=3)), - ('room_occupied', models.IntegerField(default=0)), - ('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')), - ], - ), - migrations.CreateModel( - name='HallCaretaker', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')), - ('staff', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.staff')), - ], - ), - migrations.CreateModel( - name='GuestRoomDetail', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('room_no', models.CharField(max_length=4, unique=True)), - ('room_status', models.CharField(choices=[('Booked', 'Booked'), ('CheckedIn', 'Checked In'), ('Available', 'Available'), ('UnderMaintenance', 'Under Maintenance')], default='Available', max_length=20)), - ('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')), - ], - ), - migrations.CreateModel( - name='GuestRoomBooking', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('guest_name', models.CharField(max_length=100)), - ('guest_phone', models.CharField(max_length=15)), - ('guest_email', models.CharField(blank=True, max_length=40)), - ('guest_address', models.TextField(blank=True)), - ('rooms_required', models.IntegerField(blank=True, default=1, null=True)), - ('total_guest', models.IntegerField(default=1)), - ('purpose', models.TextField()), - ('arrival_date', models.DateField()), - ('arrival_time', models.TimeField()), - ('departure_date', models.DateField()), - ('departure_time', models.TimeField()), - ('status', models.CharField(choices=[('Confirmed', 'Confirmed'), ('Pending', 'Pending'), ('Rejected', 'Rejected'), ('Canceled', 'Canceled'), ('CancelRequested', 'Cancel Requested'), ('CheckedIn', 'Checked In'), ('Complete', 'Complete'), ('Forward', 'Forward')], default='Pending', max_length=15)), - ('booking_date', models.DateField(default=django.utils.timezone.now)), - ('nationality', models.CharField(blank=True, max_length=20)), - ('guest_room_id', models.ManyToManyField(to='hostel_management.GuestRoomDetail')), - ('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')), - ('intender', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - ] diff --git a/FusionIIIT/applications/hostel_management/migrations/__init__.py b/FusionIIIT/applications/hostel_management/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/hostel_management/models.py b/FusionIIIT/applications/hostel_management/models.py index 9b667d9e2..1108f573a 100644 --- a/FusionIIIT/applications/hostel_management/models.py +++ b/FusionIIIT/applications/hostel_management/models.py @@ -48,7 +48,14 @@ class Hall(models.Model): hall_name = models.CharField(max_length=50) max_accomodation = models.IntegerField(default=0) number_students = models.PositiveIntegerField(default=0) - + assigned_batch = models.CharField(max_length=50, null=True, blank=True) + TYPE_OF_SEATER_CHOICES = [ + ('single', 'Single Seater'), + ('double', 'Double Seater'), + ('triple', 'Triple Seater'), + ] + + type_of_seater = models.CharField(max_length=50, choices=TYPE_OF_SEATER_CHOICES, default='single') def __str__(self): return self.hall_id @@ -81,20 +88,7 @@ def __str__(self): return str(self.hall) + ' (' + str(self.faculty.id.user.username) + ')' -class GuestRoomDetail(models.Model): - """ - Records information related to guest rooms in Hall of Residences. - 'hall' refers to the related Hall of Residence. - 'room_no' stores the guest room number. - 'room_status' stores the current status of the guest room from the available choices in 'ROOM_STATUS'. - """ - hall = models.ForeignKey(Hall, on_delete=models.CASCADE) - room_no = models.CharField(max_length=4, unique=True) - room_status = models.CharField(max_length=20, choices=HostelManagementConstants.ROOM_STATUS, default='Available') - - def __str__(self): - return self.room_no class GuestRoomBooking(models.Model): @@ -116,26 +110,27 @@ class GuestRoomBooking(models.Model): """ hall = models.ForeignKey(Hall, on_delete=models.CASCADE) intender = models.ForeignKey(User, on_delete=models.CASCADE) - guest_name = models.CharField(max_length=100) - guest_phone = models.CharField(max_length=15) - guest_email = models.CharField(max_length=40, blank=True) + guest_name = models.CharField(max_length=255) + guest_phone = models.CharField(max_length=255) + guest_email = models.CharField(max_length=255, blank=True) guest_address = models.TextField(blank=True) - rooms_required = models.IntegerField(default=1,null=True,blank=True) - guest_room_id = models.ManyToManyField(GuestRoomDetail) + rooms_required = models.IntegerField(default=1, null=True, blank=True) + guest_room_id = models.CharField(max_length=255, blank=True) total_guest = models.IntegerField(default=1) purpose = models.TextField() arrival_date = models.DateField(auto_now_add=False, auto_now=False) arrival_time = models.TimeField(auto_now_add=False, auto_now=False) departure_date = models.DateField(auto_now_add=False, auto_now=False) departure_time = models.TimeField(auto_now_add=False, auto_now=False) - status = models.CharField(max_length=15, choices=HostelManagementConstants.BOOKING_STATUS ,default ="Pending") + status = models.CharField(max_length=255, choices=HostelManagementConstants.BOOKING_STATUS ,default ="Pending") booking_date = models.DateField(auto_now_add=False, auto_now=False, default=timezone.now) - nationality = models.CharField(max_length=20, blank=True) + nationality = models.CharField(max_length=255, blank=True) def __str__(self): return '%s ----> %s - %s' % (self.id, self.guest_name, self.status) + class StaffSchedule(models.Model): """ Records schedule of staffs in various Hall of Residences. @@ -147,7 +142,7 @@ class StaffSchedule(models.Model): 'end_time' stores the end time of a schedule. """ hall = models.ForeignKey(Hall, on_delete=models.CASCADE) - staff_id = models.ForeignKey(Staff, on_delete=models.ForeignKey) + staff_id = models.ForeignKey(Staff, on_delete=models.CASCADE) staff_type = models.CharField(max_length=100, default='Caretaker') day = models.CharField(max_length=15, choices=HostelManagementConstants.DAYS_OF_WEEK) start_time = models.TimeField(null=True,blank=True) @@ -236,4 +231,129 @@ class WorkerReport(models.Model): remark = models.CharField(max_length=100) def str(self): - return str(self.worker_name)+'->' + str(self.month) + '-' + str(self.absent) \ No newline at end of file + return str(self.worker_name)+'->' + str(self.month) + '-' + str(self.absent) + + + +class HostelInventory(models.Model): + """ + Model to store hostel inventory information. + """ + + inventory_id = models.AutoField(primary_key=True) + hall = models.ForeignKey(Hall, on_delete=models.CASCADE) + inventory_name = models.CharField(max_length=100) + cost = models.DecimalField(max_digits=10, decimal_places=2) + quantity = models.PositiveIntegerField(default=0) + + def __str__(self): + return self.inventory_name + + +class HostelLeave(models.Model): + student_name = models.CharField(max_length=100) + roll_num = models.CharField(max_length=20) + reason = models.TextField() + start_date = models.DateField(default=timezone.now) + end_date = models.DateField() + status = models.CharField(max_length=20, default='pending') + remark = models.TextField(blank=True, null=True) + + + def __str__(self): + return f"{self.student_name}'s Leave" + +# changes + +class HostelComplaint(models.Model): + hall_name = models.CharField(max_length=100) + student_name = models.CharField(max_length=100) + roll_number = models.CharField(max_length=20) + description = models.TextField() + contact_number = models.CharField(max_length=15) + + def __str__(self): + return f"Complaint from {self.student_name} in {self.hall_name}" + + +class HostelAllotment(models.Model): + hall = models.ForeignKey(Hall, on_delete=models.CASCADE) + assignedCaretaker = models.ForeignKey(Staff, on_delete=models.CASCADE ,null=True) + assignedWarden = models.ForeignKey(Faculty, on_delete=models.CASCADE ,null=True) + assignedBatch=models.CharField(max_length=50) + def __str__(self): + return str(self.hall)+ str(self.assignedCaretaker)+str(self.assignedWarden) + str(self.assignedBatch) + +class StudentDetails(models.Model): + id = models.CharField(primary_key=True, max_length=20) + first_name = models.CharField(max_length=100,blank=True,null=True) + last_name = models.CharField(max_length=100,blank=True,null=True) + programme = models.CharField(max_length=100,blank=True,null=True) + batch = models.CharField(max_length=100,blank=True,null=True) + room_num= models.CharField(max_length=20,blank=True,null=True) + hall_no= models.CharField(max_length=20,blank=True,null=True) + hall_id=models.CharField(max_length=20,blank=True,null=True) + specialization = models.CharField(max_length=100,blank=True,null=True) + parent_contact = models.CharField(max_length=20, blank=True, null=True) + address = models.CharField(max_length=255, blank=True, null=True) + + def __str__(self): + return self.first_name + + + +class GuestRoom(models.Model): + """ + 'hall' foreign key: the hostel to which the room belongs + 'room' guest room number + 'vacant' boolean value to determine if the room is vacant + 'occupied_till', date field that tells the next time the room will be vacant, null if 'vacant' == True + """ + hall = models.ForeignKey(Hall, on_delete=models.CASCADE) + room = models.CharField(max_length=255) + occupied_till = models.DateField(null=True, blank=True) + vacant = models.BooleanField(default=True) + @property + def _vacant(self) -> bool: + if self.occupied_till and self.occupied_till > timezone.now(): + self.vacant = False + self.vacant = True + + + +class HostelFine(models.Model): + fine_id = models.AutoField(primary_key=True) + student = models.ForeignKey(Student, on_delete=models.CASCADE) + hall = models.ForeignKey(Hall, on_delete=models.CASCADE,default=1) + student_name = models.CharField(max_length=100) + amount = models.DecimalField(max_digits=10, decimal_places=2) + STATUS_CHOICES = [ + ('Pending', 'Pending'), + ('Paid', 'Paid'), + ] + status = models.CharField(max_length=50, choices=STATUS_CHOICES, default='Pending') + reason = models.TextField() + + def __str__(self): + return f"{self.student_name}'s Fine - {self.amount} - {self.status}" + + +class HostelTransactionHistory(models.Model): + hall = models.ForeignKey(Hall, on_delete=models.CASCADE) + change_type = models.CharField(max_length=100) # Example: 'Caretaker', 'Warden', 'Batch' + previous_value = models.CharField(max_length=255) + new_value = models.CharField(max_length=255) + timestamp = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return f"{self.change_type} change in {self.hall} at {self.timestamp}" + +class HostelHistory(models.Model): + hall = models.ForeignKey(Hall, on_delete=models.CASCADE) + timestamp = models.DateTimeField(default=timezone.now) + caretaker = models.ForeignKey(Staff, on_delete=models.SET_NULL, null=True, related_name='caretaker_history') + batch = models.CharField(max_length=50, null=True) + warden = models.ForeignKey(Faculty, on_delete=models.SET_NULL, null=True, related_name='warden_history') + + def __str__(self): + return f"History for {self.hall.hall_name} - {self.timestamp}" \ No newline at end of file diff --git a/FusionIIIT/applications/hostel_management/urls.py b/FusionIIIT/applications/hostel_management/urls.py index f0ea19b1d..5b64da506 100644 --- a/FusionIIIT/applications/hostel_management/urls.py +++ b/FusionIIIT/applications/hostel_management/urls.py @@ -1,11 +1,18 @@ from django.urls import path from . import views +from django.contrib.auth import views as auth_views +from django.urls import include +from django.contrib import admin +from django.conf.urls import url, include app_name = 'hostelmanagement' urlpatterns = [ + + path('admin/', admin.site.urls), #Home path('', views.hostel_view, name="hostel_view"), + path('/hello', views.hostel_view, name="hello"), #Notice Board path('notice_form/', views.notice_board, name="notice_board"), @@ -28,4 +35,77 @@ #Worker Report path('worker_report/', views.generate_worker_report, name='workerreport'), path('pdf/', views.GeneratePDF.as_view(), name="pdf"), + + + + #for superUser + + path('hostel-notices/', views.hostel_notice_board, name='hostel_notices_board'), + # //caretaker and warden can see all leaves + path('all_leave_data/', views.all_leave_data, name='all_leave_data'), + # caretaker or wardern can approve leave + path('update_leave_status/', views.update_leave_status, name='update_leave_status'), + # //apply for leave + path('create_hostel_leave/', views.create_hostel_leave, name='create_hostel_leave'), + + # caretaker and warden can get all complaints + path('hostel_complaints/', views.hostel_complaint_list, name='hostel_complaint_list'), + + path('register_complaint/', views.PostComplaint.as_view(), name='PostComplaint'), + +# Student can view his leave status + path('my_leaves/', views.my_leaves.as_view(), name='my_leaves'), + path('get_students/', views.get_students, name='get_students'), + + + + + + path('assign-batch/', views.AssignBatchView.as_view(),name='AssignBatchView'), + path('hall-ids/', views.HallIdView.as_view(), name='hall'), + path('assign-caretaker', views.AssignCaretakerView.as_view(), name='AssignCaretakerView'), + path('assign-warden',views.AssignWardenView.as_view(), name='AssignWardenView'), + path('add-hostel', views.AddHostelView.as_view(), name='add_hostel'), + path('admin-hostel-list', views.AdminHostelListView.as_view(), name='admin_hostel_list'), # URL for displaying the list of hostels + path('delete-hostel//', views.DeleteHostelView.as_view(), name='delete_hostel'), + + path('check-hall-exists/', views.CheckHallExistsView.as_view(), name='check_hall_exists'), + path('accounts/', include('django.contrib.auth.urls')), + path('logout/', views.logout_view, name='logout_view'), + # path('logout/', auth_views.LogoutView.as_view(), name='logout'), + + # !! My Change + path('allotted_rooms//', views.alloted_rooms, name="alloted_rooms"), + + path('all_staff//', views.all_staff, name='all_staff'), + path('staff//', views.StaffScheduleView.as_view(), name='staff_schedule'), + + # !!? Inventory + path('inventory/', views.HostelInventoryView.as_view(), name='hostel_inventory_list'), + path('inventory//modify/', views.HostelInventoryUpdateView.as_view(), name='hostel_inventory_update'), + path('inventory//delete/', views.HostelInventoryView.as_view(), name='hostel_inventory_delete'), + path('inventory//', views.HostelInventoryView.as_view(), name='hostel_inventory_by_hall'), + path('inventory/form/', views.get_inventory_form, name='get_inventory_form'), + path('inventory/edit_inventory//', views.edit_inventory, name='edit_inventory'), + path('allotted_rooms/', views.alloted_rooms_main, name="alloted_rooms"), + path('all_staff/', views.all_staff, name='all_staff'), + + #guest room + path('book_guest_room/', views.request_guest_room, name="book_guest_room"), + path('update_guest_room/', views.update_guest_room, name="update_guest_room"), + + + # !!todo: Add Fine Functionality + path('fine/', views.impose_fine_view, name='fine_form_show'), + path('fine/impose/', views.HostelFineView.as_view(), name='fine_form_show'), + path('fine/impose/list/', views.hostel_fine_list, name='fine_list_show'), + path('fine/impose/list/update//', views.HostelFineUpdateView.as_view(), name='fine_update'), + path('fine/delete//', views.HostelFineUpdateView.as_view(), name='fine_delete'), + path('fine/show/', views.student_fine_details, name='fine_show'), + + + + path('student//name/', views.get_student_name, name='find_name'), + + ] \ No newline at end of file diff --git a/FusionIIIT/applications/hostel_management/views.py b/FusionIIIT/applications/hostel_management/views.py index 0015748a4..aae447a88 100644 --- a/FusionIIIT/applications/hostel_management/views.py +++ b/FusionIIIT/applications/hostel_management/views.py @@ -1,8 +1,45 @@ +from django.core.serializers import serialize +from django.http import HttpResponseBadRequest +from .models import HostelLeave, HallCaretaker +from applications.hostel_management.models import HallCaretaker, HallWarden +from django.http import JsonResponse, HttpResponse +from django.db import IntegrityError +from rest_framework.exceptions import NotFound +from django.shortcuts import redirect +from django.template import loader +from django.shortcuts import get_object_or_404 from django.shortcuts import render from django.http import HttpResponseRedirect +from django.shortcuts import render, HttpResponse +from django.views.decorators.csrf import csrf_exempt +from rest_framework.permissions import IsAuthenticated +from .models import HallCaretaker, HallWarden from django.urls import reverse +from .models import StudentDetails +from rest_framework.exceptions import APIException + + + +from django.shortcuts import render, redirect + +from .models import HostelLeave +from rest_framework.authentication import SessionAuthentication, BasicAuthentication +from django.utils.decorators import method_decorator +from django.contrib.auth.decorators import login_required +from django.db.models import Q + +from rest_framework.views import APIView +from rest_framework.response import Response +from rest_framework.authentication import SessionAuthentication +from rest_framework.permissions import IsAuthenticated +from rest_framework import status + + + from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User +# from .models import HostelStudentAttendance +from django.http import JsonResponse from applications.globals.models import (Designation, ExtraInfo, HoldsDesignation, DepartmentInfo) from applications.academic_information.models import Student @@ -10,18 +47,43 @@ from django.db.models import Q import datetime from datetime import time, datetime, date -from time import mktime, time,localtime +from time import mktime, time, localtime from .models import * import xlrd -from .forms import HostelNoticeBoardForm +from .forms import GuestRoomBookingForm, HostelNoticeBoardForm import re from django.http import HttpResponse from django.template.loader import get_template from django.views.generic import View from django.db.models import Q from django.contrib import messages -from .utils import render_to_pdf, save_worker_report_sheet,get_caretaker_hall +from .utils import render_to_pdf, save_worker_report_sheet, get_caretaker_hall from .utils import add_to_room, remove_from_room +from rest_framework.views import APIView +from rest_framework.response import Response +from rest_framework import status +from django.http import JsonResponse +from rest_framework.authentication import SessionAuthentication +from rest_framework.permissions import IsAuthenticated +import json + +from django.utils.decorators import method_decorator +from django.contrib.auth.decorators import user_passes_test +from django.contrib.auth import logout +from django.contrib.auth.decorators import login_required +from Fusion.settings.common import LOGIN_URL +from django.shortcuts import get_object_or_404, redirect, render +from django.db import transaction +from .forms import HallForm +from notification.views import hostel_notifications + + +def is_superuser(user): + return user.is_authenticated and user.is_superuser + + +# //! My change + @login_required def hostel_view(request, context={}): @@ -39,94 +101,262 @@ def hostel_view(request, context={}): all_hall - stores all the hall of residence all_notice - stores all notices of hostels (latest first) """ - + # Check if the user is a superuser + is_superuser = request.user.is_superuser + all_hall = Hall.objects.all() halls_student = {} for hall in all_hall: - halls_student[hall.hall_id] = Student.objects.filter(hall_no=int(hall.hall_id[4])).select_related('id__user') + halls_student[hall.hall_id] = Student.objects.filter( + hall_no=int(hall.hall_id[4])).select_related('id__user') hall_staffs = {} for hall in all_hall: - hall_staffs[hall.hall_id] = StaffSchedule.objects.filter(hall=hall).select_related('staff_id__id__user') + hall_staffs[hall.hall_id] = StaffSchedule.objects.filter( + hall=hall).select_related('staff_id__id__user') all_notice = HostelNoticeBoard.objects.all().order_by("-id") hall_notices = {} for hall in all_hall: - hall_notices[hall.hall_id] = HostelNoticeBoard.objects.filter(hall=hall).select_related('hall','posted_by__user') + hall_notices[hall.hall_id] = HostelNoticeBoard.objects.filter( + hall=hall).select_related('hall', 'posted_by__user') + + pending_guest_room_requests = {} + for hall in all_hall: + pending_guest_room_requests[hall.hall_id] = GuestRoomBooking.objects.filter( + hall=hall, status='Pending').select_related('hall', 'intender') + + + guest_rooms = {} + for hall in all_hall: + guest_rooms[hall.hall_id] = GuestRoom.objects.filter( + hall=hall,vacant=True).select_related('hall') + user_guest_room_requests = GuestRoomBooking.objects.filter( + intender=request.user).order_by("-arrival_date") + + halls = Hall.objects.all() + # Create a list to store additional details + hostel_details = [] + + # Loop through each hall and fetch assignedCaretaker and assignedWarden + for hall in halls: + try: + caretaker = HallCaretaker.objects.filter(hall=hall).first() + warden = HallWarden.objects.filter(hall=hall).first() + except HostelAllotment.DoesNotExist: + assigned_caretaker = None + assigned_warden = None + + vacant_seat=(hall.max_accomodation-hall.number_students) + hostel_detail = { + 'hall_id': hall.hall_id, + 'hall_name': hall.hall_name, + 'seater_type':hall.type_of_seater, + 'max_accomodation': hall.max_accomodation, + 'number_students': hall.number_students, + 'vacant_seat':vacant_seat, + 'assigned_batch': hall.assigned_batch, + 'assigned_caretaker': caretaker.staff.id.user.username if caretaker else None, + 'assigned_warden': warden.faculty.id.user.username if warden else None, + } + + hostel_details.append(hostel_detail) Staff_obj = Staff.objects.all().select_related('id__user') hall1 = Hall.objects.get(hall_id='hall1') - hall3=Hall.objects.get(hall_id='hall3') - hall4=Hall.objects.get(hall_id='hall4') + hall3 = Hall.objects.get(hall_id='hall3') + hall4 = Hall.objects.get(hall_id='hall4') hall1_staff = StaffSchedule.objects.filter(hall=hall1) hall3_staff = StaffSchedule.objects.filter(hall=hall3) hall4_staff = StaffSchedule.objects.filter(hall=hall4) hall_caretakers = HallCaretaker.objects.all().select_related() hall_wardens = HallWarden.objects.all().select_related() - - hall_student="" - current_hall="" - get_avail_room=[] - get_hall=get_caretaker_hall(hall_caretakers,request.user) + all_students = Student.objects.all().select_related('id__user') + all_students_id = [] + for student in all_students: + all_students_id.append(student.id_id) + # print(all_students) + hall_student = "" + current_hall = "" + get_avail_room = [] + get_hall = get_caretaker_hall(hall_caretakers, request.user) if get_hall: - get_hall_num=re.findall('[0-9]+',str(get_hall.hall_id)) - hall_student=Student.objects.filter(hall_no=int(str(get_hall_num[0]))).select_related('id__user') - current_hall='hall'+str(get_hall_num[0]) - + get_hall_num = re.findall('[0-9]+', str(get_hall.hall_id)) + hall_student = Student.objects.filter(hall_no=int( + str(get_hall_num[0]))).select_related('id__user') + current_hall = 'hall'+str(get_hall_num[0]) + for hall in all_hall: - total_rooms=HallRoom.objects.filter(hall=hall) + total_rooms = HallRoom.objects.filter(hall=hall) for room in total_rooms: - if(room.room_cap>room.room_occupied): + if (room.room_cap > room.room_occupied): get_avail_room.append(room) - hall_caretaker_user=[] + hall_caretaker_user = [] for caretaker in hall_caretakers: hall_caretaker_user.append(caretaker.staff.id.user) hall_warden_user = [] for warden in hall_wardens: hall_warden_user.append(warden.faculty.id.user) - + + all_students = Student.objects.all().select_related('id__user') + all_students_id = [] + for student in all_students: + all_students_id.append(student.id_id) + todays_date = date.today() current_year = todays_date.year current_month = todays_date.month if current_month != 1: - worker_report = WorkerReport.objects.filter(Q(hall__hall_id=current_hall, year=current_year, month=current_month) | Q(hall__hall_id=current_hall, year=current_year, month=current_month-1)) + worker_report = WorkerReport.objects.filter(Q(hall__hall_id=current_hall, year=current_year, month=current_month) | Q( + hall__hall_id=current_hall, year=current_year, month=current_month-1)) else: - worker_report = WorkerReport.objects.filter(hall__hall_id=current_hall, year=current_year-1, month=12) + worker_report = WorkerReport.objects.filter( + hall__hall_id=current_hall, year=current_year-1, month=12) attendance = HostelStudentAttendence.objects.all().select_related() halls_attendance = {} for hall in all_hall: - halls_attendance[hall.hall_id] = HostelStudentAttendence.objects.filter(hall=hall).select_related() + halls_attendance[hall.hall_id] = HostelStudentAttendence.objects.filter( + hall=hall).select_related() + + user_complaints = HostelComplaint.objects.filter( + roll_number=request.user.username) + user_leaves = HostelLeave.objects.filter(roll_num=request.user.username) + my_leaves = [] + for leave in user_leaves: + my_leaves.append(leave) + my_complaints = [] + for complaint in user_complaints: + my_complaints.append(complaint) + + all_leaves = HostelLeave.objects.all() + all_complaints = HostelComplaint.objects.all() + + add_hostel_form = HallForm() + warden_ids = Faculty.objects.all().select_related('id__user') + + # //! My change for imposing fines + user_id = request.user + staff_fine_caretaker = user_id.extrainfo.id + students = Student.objects.all() + + fine_user = request.user + + if request.user.id in Staff.objects.values_list('id__user', flat=True): + staff_fine_caretaker = request.user.extrainfo.id + + caretaker_fine_id = HallCaretaker.objects.filter( + staff_id=staff_fine_caretaker).first() + if caretaker_fine_id: + hall_fine_id = caretaker_fine_id.hall_id + hostel_fines = HostelFine.objects.filter( + hall_id=hall_fine_id).order_by('fine_id') + context['hostel_fines'] = hostel_fines + + # caretaker_fine_id = HallCaretaker.objects.get(staff_id=staff_fine_caretaker) + # hall_fine_id = caretaker_fine_id.hall_id + # hostel_fines = HostelFine.objects.filter(hall_id=hall_fine_id).order_by('fine_id') + + if request.user.id in Staff.objects.values_list('id__user', flat=True): + staff_inventory_caretaker = request.user.extrainfo.id + + caretaker_inventory_id = HallCaretaker.objects.filter( + staff_id=staff_inventory_caretaker).first() + + if caretaker_inventory_id: + hall_inventory_id = caretaker_inventory_id.hall_id + inventories = HostelInventory.objects.filter( + hall_id=hall_inventory_id).order_by('inventory_id') + + # Serialize inventory data + inventory_data = [] + for inventory in inventories: + inventory_data.append({ + 'inventory_id': inventory.inventory_id, + 'hall_id': inventory.hall_id, + 'inventory_name': inventory.inventory_name, + # Convert DecimalField to string + 'cost': str(inventory.cost), + 'quantity': inventory.quantity, + }) + + inventory_data.sort(key=lambda x: x['inventory_id']) + context['inventories'] = inventory_data + + # all students details for caretaker and warden + if request.user.id in Staff.objects.values_list('id__user', flat=True): + staff_student_info = request.user.extrainfo.id + + if HallCaretaker.objects.filter(staff_id=staff_student_info).exists(): + hall_caretaker_id = HallCaretaker.objects.get( + staff_id=staff_student_info).hall_id + + hall_num = Hall.objects.get(id=hall_caretaker_id) + hostel_students_details = StudentDetails.objects.filter(hall_id=hall_num) + context['hostel_students_details']= hostel_students_details + elif HallWarden.objects.filter(faculty_id=staff_student_info).exists(): + hall_warden_id = HallWarden.objects.get( + faculty_id=staff_student_info).hall_id + + hall_num = Hall.objects.get(id=hall_warden_id) + hostel_students_details = StudentDetails.objects.filter(hall_id=hall_num) + context['hostel_students_details'] = hostel_students_details + + + # print(request.user.username); + if Student.objects.filter(id_id=request.user.username).exists(): + user_id = request.user.username + student_fines = HostelFine.objects.filter(student_id=user_id) + # print(student_fines) + context['student_fines'] = student_fines + hostel_transactions = HostelTransactionHistory.objects.order_by('-timestamp') + # Retrieve all hostel history entries + hostel_history = HostelHistory.objects.order_by('-timestamp') context = { - + 'all_hall': all_hall, 'all_notice': all_notice, - 'staff':Staff_obj, - 'hall1_staff' : hall1_staff, - 'hall3_staff' : hall3_staff, - 'hall4_staff' : hall4_staff, - 'hall_caretaker' : hall_caretaker_user, - 'hall_warden' : hall_warden_user, - 'room_avail' : get_avail_room, - 'hall_student':hall_student, + 'staff': Staff_obj, + 'hall1_staff': hall1_staff, + 'hall3_staff': hall3_staff, + 'hall4_staff': hall4_staff, + 'hall_caretaker': hall_caretaker_user, + 'hall_warden': hall_warden_user, + 'room_avail': get_avail_room, + 'hall_student': hall_student, 'worker_report': worker_report, 'halls_student': halls_student, - 'current_hall' : current_hall, + 'current_hall': current_hall, 'hall_staffs': hall_staffs, 'hall_notices': hall_notices, 'attendance': halls_attendance, + 'guest_rooms': guest_rooms, + 'pending_guest_room_requests': pending_guest_room_requests, + 'user_guest_room_requests': user_guest_room_requests, + 'all_students_id': all_students_id, + 'is_superuser': is_superuser, + 'warden_ids': warden_ids, + 'add_hostel_form': add_hostel_form, + 'hostel_details': hostel_details, + 'all_students_id': all_students_id, + 'my_complaints': my_complaints, + 'my_leaves': my_leaves, + 'all_leaves': all_leaves, + 'all_complaints': all_complaints, + 'staff_fine_caretaker': staff_fine_caretaker, + 'students': students, + 'hostel_transactions':hostel_transactions, + 'hostel_history':hostel_history, **context } return render(request, 'hostelmanagement/hostel.html', context) - - - + def staff_edit_schedule(request): """ This function is responsible for creating a new or updating an existing staff schedule. @@ -144,31 +374,33 @@ def staff_edit_schedule(request): hall_caretakers - stores all hall caretakers. """ if request.method == 'POST': - start_time= datetime.datetime.strptime(request.POST["start_time"],'%H:%M').time() - end_time= datetime.datetime.strptime(request.POST["end_time"],'%H:%M').time() - staff_name=request.POST["Staff_name"] - staff_type=request.POST["staff_type"] - day=request.POST["day"] + start_time = datetime.datetime.strptime( + request.POST["start_time"], '%H:%M').time() + end_time = datetime.datetime.strptime( + request.POST["end_time"], '%H:%M').time() + staff_name = request.POST["Staff_name"] + staff_type = request.POST["staff_type"] + day = request.POST["day"] - staff=Staff.objects.get(pk=staff_name) + staff = Staff.objects.get(pk=staff_name) try: - staff_schedule=StaffSchedule.objects.get(staff_id=staff) - staff_schedule.day=day - staff_schedule.start_time=start_time - staff_schedule.end_time=end_time - staff_schedule.staff_type=staff_type + staff_schedule = StaffSchedule.objects.get(staff_id=staff) + staff_schedule.day = day + staff_schedule.start_time = start_time + staff_schedule.end_time = end_time + staff_schedule.staff_type = staff_type staff_schedule.save() messages.success(request, 'Staff schedule updated successfully.') except: hall_caretakers = HallCaretaker.objects.all() - get_hall="" - get_hall=get_caretaker_hall(hall_caretakers,request.user) - StaffSchedule(hall=get_hall,staff_id=staff,day=day,staff_type=staff_type,start_time=start_time,end_time=end_time).save() + get_hall = "" + get_hall = get_caretaker_hall(hall_caretakers, request.user) + StaffSchedule(hall=get_hall, staff_id=staff, day=day, + staff_type=staff_type, start_time=start_time, end_time=end_time).save() messages.success(request, 'Staff schedule created successfully.') return HttpResponseRedirect(reverse("hostelmanagement:hostel_view")) - def staff_delete_schedule(request): """ This function is responsible for deleting an existing staff schedule. @@ -181,9 +413,9 @@ def staff_delete_schedule(request): staff_schedule - stores staff schedule related to 'staff' """ if request.method == 'POST': - staff_dlt_id=request.POST["dlt_schedule"] - staff=Staff.objects.get(pk=staff_dlt_id) - staff_schedule=StaffSchedule.objects.get(staff_id=staff) + staff_dlt_id = request.POST["dlt_schedule"] + staff = Staff.objects.get(pk=staff_dlt_id) + staff_schedule = StaffSchedule.objects.get(staff_id=staff) staff_schedule.delete() return HttpResponseRedirect(reverse("hostelmanagement:hostel_view")) @@ -209,9 +441,9 @@ def notice_board(request): head_line = form.cleaned_data['head_line'] content = form.cleaned_data['content'] description = form.cleaned_data['description'] - + new_notice = HostelNoticeBoard.objects.create(hall=hall, posted_by=request.user.extrainfo, head_line=head_line, content=content, - description=description) + description=description) new_notice.save() messages.success(request, 'Notice created successfully.') @@ -230,11 +462,12 @@ def delete_notice(request): notice - stores HostelNoticeBoard object related to 'notice_id' """ if request.method == 'POST': - notice_id=request.POST["dlt_notice"] - notice=HostelNoticeBoard.objects.get(pk=notice_id) + notice_id = request.POST["dlt_notice"] + notice = HostelNoticeBoard.objects.get(pk=notice_id) notice.delete() return HttpResponseRedirect(reverse("hostelmanagement:hostel_view")) + def edit_student_rooms_sheet(request): """ This function is used to edit the room and hall of a multiple students. @@ -257,13 +490,14 @@ def edit_student_rooms_sheet(request): hall_no = str(int(hall_no)) room_no = row[2].value - block=str(room_no[0]) + block = str(room_no[0]) room = re.findall('[0-9]+', room_no) is_valid = True student = Student.objects.filter(id=roll_no.strip()) hall = Hall.objects.filter(hall_id="hall"+hall_no[0]) if student and hall.exists(): - Room = HallRoom.objects.filter(hall=hall[0],block_no=block,room_no=str(room[0])) + Room = HallRoom.objects.filter( + hall=hall[0], block_no=block, room_no=str(room[0])) if Room.exists() and Room[0].room_occupied < Room[0].room_cap: continue else: @@ -279,18 +513,17 @@ def edit_student_rooms_sheet(request): if not is_valid: return HttpResponseRedirect(reverse("hostelmanagement:hostel_view")) - + for row in all_rows: if row[0].value == "Roll No": continue roll_no = row[0].value if row[0].ctype == 2: roll_no = str(int(roll_no)) - hall_no = str(int(row[1].value)) room_no = row[2].value - block=str(room_no[0]) + block = str(room_no[0]) room = re.findall('[0-9]+', room_no) is_valid = True student = Student.objects.filter(id=roll_no.strip()) @@ -315,8 +548,8 @@ def edit_student_room(request): """ if request.method == "POST": roll_no = request.POST["roll_no"] - hall_room_no=request.POST["hall_room_no"] - index=hall_room_no.find('-') + hall_room_no = request.POST["hall_room_no"] + index = hall_room_no.find('-') room_no = hall_room_no[index+1:] hall_no = hall_room_no[:index] student = Student.objects.get(id=roll_no) @@ -325,12 +558,13 @@ def edit_student_room(request): messages.success(request, 'Student room changed successfully.') return HttpResponseRedirect(reverse("hostelmanagement:hostel_view")) + def edit_attendance(request): """ This function is used to edit the attendance of a student. @param: request - HttpRequest object containing metadata about the user request. - + @variables: student_id = The student whose attendance has to be updated. hall = The hall of the concerned student. @@ -338,17 +572,18 @@ def edit_attendance(request): """ if request.method == "POST": roll_no = request.POST["roll_no"] - + student = Student.objects.get(id=roll_no) hall = Hall.objects.get(hall_id='hall'+str(student.hall_no)) date = datetime.datetime.today().strftime('%Y-%m-%d') - if HostelStudentAttendence.objects.filter(student_id=student,date=date).exists() == True: - messages.error(request, f'{student.id.id} is already marked present on {date}') + if HostelStudentAttendence.objects.filter(student_id=student, date=date).exists() == True: + messages.error( + request, f'{student.id.id} is already marked present on {date}') return HttpResponseRedirect(reverse("hostelmanagement:hostel_view")) - record = HostelStudentAttendence.objects.create(student_id=student, \ - hall=hall, date=date, present=True) + record = HostelStudentAttendence.objects.create(student_id=student, + hall=hall, date=date, present=True) record.save() messages.success(request, f'Attendance of {student.id.id} recorded.') @@ -356,8 +591,6 @@ def edit_attendance(request): return HttpResponseRedirect(reverse("hostelmanagement:hostel_view")) - - @login_required def generate_worker_report(request): """ @@ -372,19 +605,20 @@ def generate_worker_report(request): sheet - stores a sheet from the uploaded spreadsheet. """ if request.method == "POST": - try: - files = request.FILES['upload_report'] - excel = xlrd.open_workbook(file_contents=files.read()) - user_id = request.user.extrainfo.id - if str(excel.sheets()[0].cell(0,0).value)[:5].lower() == str(HallCaretaker.objects.get(staff__id=user_id).hall): - for sheet in excel.sheets(): - save_worker_report_sheet(excel,sheet,user_id) - return HttpResponseRedirect(reverse("hostelmanagement:hostel_view")) + try: + files = request.FILES['upload_report'] + excel = xlrd.open_workbook(file_contents=files.read()) + user_id = request.user.extrainfo.id + if str(excel.sheets()[0].cell(0, 0).value)[:5].lower() == str(HallCaretaker.objects.get(staff__id=user_id).hall): + for sheet in excel.sheets(): + save_worker_report_sheet(excel, sheet, user_id) + return HttpResponseRedirect(reverse("hostelmanagement:hostel_view")) - return HttpResponseRedirect(reverse("hostelmanagement:hostel_view")) - except: - messages.error(request,"Please upload a file in valid format before submitting") - return HttpResponseRedirect(reverse("hostelmanagement:hostel_view")) + return HttpResponseRedirect(reverse("hostelmanagement:hostel_view")) + except: + messages.error( + request, "Please upload a file in valid format before submitting") + return HttpResponseRedirect(reverse("hostelmanagement:hostel_view")) class GeneratePDF(View): @@ -412,27 +646,1191 @@ def get(self, request, *args, **kwargs): template = get_template('hostelmanagement/view_report.html') hall_caretakers = HallCaretaker.objects.all() - get_hall="" - get_hall=get_caretaker_hall(hall_caretakers,request.user) - print(get_hall) + get_hall = "" + get_hall = get_caretaker_hall(hall_caretakers, request.user) + if months < current_month: - worker_report = WorkerReport.objects.filter(hall=get_hall, month__gte=current_month-months, year=current_year) + worker_report = WorkerReport.objects.filter( + hall=get_hall, month__gte=current_month-months, year=current_year) else: - worker_report = WorkerReport.objects.filter(Q(hall=get_hall, year=current_year, month__lte=current_month) | Q(hall=get_hall, year=current_year-1, month__gte=12-months+current_month)) - + worker_report = WorkerReport.objects.filter(Q(hall=get_hall, year=current_year, month__lte=current_month) | Q( + hall=get_hall, year=current_year-1, month__gte=12-months+current_month)) + worker = { - 'worker_report' : worker_report + 'worker_report': worker_report } html = template.render(worker) pdf = render_to_pdf('hostelmanagement/view_report.html', worker) if pdf: response = HttpResponse(pdf, content_type='application/pdf') - filename = "Invoice_%s.pdf" %("12341231") - content = "inline; filename='%s'" %(filename) + filename = "Invoice_%s.pdf" % ("12341231") + content = "inline; filename='%s'" % (filename) download = request.GET.get("download") if download: - content = "attachment; filename='%s'" %(filename) + content = "attachment; filename='%s'" % (filename) response['Content-Disposition'] = content return response return HttpResponse("Not found") + +def hostel_notice_board(request): + notices = all().values('id', 'hall', 'posted_by', + 'head_line', 'content', 'description') + data = list(notices) + return JsonResponse(data, safe=False) + + +@login_required +def all_leave_data(request): + user_id = request.user.id # Using request.user to get the user ID + try: + # Assuming the user's profile is stored in extrainfo + staff = request.user.extrainfo.id + except AttributeError: + staff = None + + if staff is not None and HallCaretaker.objects.filter(staff_id=staff).exists(): + all_leave = HostelLeave.objects.all() + return render(request, 'hostelmanagement/all_leave_data.html', {'all_leave': all_leave}) + else: + return HttpResponse('') + + +@login_required +def create_hostel_leave(request): + + if request.method == 'GET': + return render(request, 'hostelmanagement/create_leave.html') + elif request.method == 'POST': + data = request.POST # Assuming you are sending form data via POST request + student_name = data.get('student_name') + roll_num = data.get('roll_num') + reason = data.get('reason') + start_date = data.get('start_date', timezone.now()) + end_date = data.get('end_date') + + + # Create HostelLeave object and save to the database + leave = HostelLeave.objects.create( + student_name=student_name, + roll_num=roll_num, + reason=reason, + start_date=start_date, + end_date=end_date, + + ) + caretakers = HallCaretaker.objects.all() + sender = request.user + type = "leave_request" + for caretaker in caretakers: + try: + # Send notification + hostel_notifications(sender, caretaker.staff.id.user, type) + except Exception as e: + # Handle notification sending error + print(f"Error sending notification to caretaker {caretaker.staff.user.username}: {e}") + + return JsonResponse({'message': 'HostelLeave created successfully'}, status=status.HTTP_201_CREATED) + + +# hostel_complaints_list caretaker can see all hostel complaints + +@login_required +def hostel_complaint_list(request): + user_id = request.user.id + + try: + # Assuming the user's profile is stored in extrainfo + staff = request.user.extrainfo.id + except AttributeError: + staff = None + + if staff is not None and HallCaretaker.objects.filter(staff_id=staff).exists(): + complaints = HostelComplaint.objects.all() + return render(request, 'hostelmanagement/hostel_complaint.html', {'complaints': complaints}) + else: + return HttpResponse('') + + +@login_required +def get_students(request): + try: + staff = request.user.extrainfo.id + print(staff) + except AttributeError: + staff = None + + if HallCaretaker.objects.filter(staff_id=staff).exists(): + hall_id = HallCaretaker.objects.get(staff_id=staff).hall_id + print(hall_id) + hall_no = Hall.objects.get(id=hall_id) + print(hall_no) + student_details = StudentDetails.objects.filter(hall_id=hall_no) + + return render(request, 'hostelmanagement/student_details.html', {'students': student_details}) + + elif HallWarden.objects.filter(faculty_id=staff).exists(): + hall_id = HallWarden.objects.get(faculty_id=staff).hall_id + student_details = StudentDetails.objects.filter(hall_id=hall_no) + + return render(request, 'hostelmanagement/student_details.html', {'students': student_details}) + else: + return HttpResponse('') + +# Student can post complaints + + +class PostComplaint(APIView): + # Assuming you are using session authentication + authentication_classes = [SessionAuthentication] + # Allow only authenticated users to access the view + permission_classes = [IsAuthenticated] + + def dispatch(self, request, *args, **kwargs): + print(request.user.username) + if not request.user.is_authenticated: + # Redirect to the login page if user is not authenticated + return redirect('/hostelmanagement') + return super().dispatch(request, *args, **kwargs) + + def get(self, request): + return render(request, 'hostelmanagement/post_complaint_form.html') + + def post(self, request): + hall_name = request.data.get('hall_name') + student_name = request.data.get('student_name') + roll_number = request.data.get('roll_number') + description = request.data.get('description') + contact_number = request.data.get('contact_number') + + # Assuming the student's name is stored in the user object + student_name = request.user.username + + complaint = HostelComplaint.objects.create( + hall_name=hall_name, + student_name=student_name, + roll_number=roll_number, + description=description, + contact_number=contact_number + ) + + # Use JavaScript to display a pop-up message after submission + return HttpResponse('') + + +# // student can see his leave status + +class my_leaves(View): + @method_decorator(login_required, name='dispatch') + def get(self, request, *args, **kwargs): + try: + # Get the user ID from the request's user + user_id = str(request.user) + + # Retrieve leaves registered by the current student based on their roll number + my_leaves = HostelLeave.objects.filter(roll_num__iexact=user_id) + # Construct the context to pass to the template + context = { + 'leaves': my_leaves + } + + # Render the template with the context data + return render(request, 'hostelmanagement/my_leaves.html', context) + + except User.DoesNotExist: + # Handle the case where the user with the given ID doesn't exist + return HttpResponse(f"User with ID {user_id} does not exist.") + + +class HallIdView(APIView): + authentication_classes = [] # Allow public access for testing + permission_classes = [] # Allow any user to access the view + + def get(self, request, *args, **kwargs): + hall_id = HostelAllotment.objects.values('hall_id') + return Response(hall_id, status=status.HTTP_200_OK) + + +@login_required(login_url=LOGIN_URL) +def logout_view(request): + logout(request) + return redirect("/") + + +@method_decorator(user_passes_test(is_superuser), name='dispatch') +class AssignCaretakerView(APIView): + authentication_classes = [SessionAuthentication] + permission_classes = [IsAuthenticated] + template_name = 'hostelmanagement/assign_caretaker.html' + + def get(self, request, *args, **kwargs): + hall = Hall.objects.all() + caretaker_usernames = Staff.objects.all() + return render(request, self.template_name, {'halls': hall, 'caretaker_usernames': caretaker_usernames}) + + def post(self, request, *args, **kwargs): + hall_id = request.data.get('hall_id') + caretaker_username = request.data.get('caretaker_username') + + try: + hall = Hall.objects.get(hall_id=hall_id) + caretaker_staff = Staff.objects.get( + id__user__username=caretaker_username) + + # Retrieve the previous caretaker for the hall, if any + prev_hall_caretaker = HallCaretaker.objects.filter(hall=hall).first() + # print(prev_hall_caretaker.staff.id) + # Delete any previous assignments of the caretaker in HallCaretaker table + HallCaretaker.objects.filter(staff=caretaker_staff).delete() + + # Delete any previous assignments of the caretaker in HostelAllotment table + HostelAllotment.objects.filter( + assignedCaretaker=caretaker_staff).delete() + + # Delete any previously assigned caretaker to the same hall + HallCaretaker.objects.filter(hall=hall).delete() + + # Assign the new caretaker to the hall in HallCaretaker table + hall_caretaker = HallCaretaker.objects.create( + hall=hall, staff=caretaker_staff) + + # # Update the assigned caretaker in Hostelallottment table + hostel_allotments = HostelAllotment.objects.filter(hall=hall) + for hostel_allotment in hostel_allotments: + hostel_allotment.assignedCaretaker = caretaker_staff + hostel_allotment.save() + + # Retrieve the current warden for the hall + current_warden = HallWarden.objects.filter(hall=hall).first() + + print("Before creating HostelTransactionHistory") + try: + history_entry = HostelTransactionHistory.objects.create( + hall=hall, + change_type='Caretaker', + previous_value= prev_hall_caretaker.staff.id if (prev_hall_caretaker and prev_hall_caretaker.staff) else 'None', + new_value=caretaker_username + ) + print("HostelTransactionHistory created successfully") + except Exception as e: + print("Error creating HostelTransactionHistory:", e) + + + # Create hostel history + try: + HostelHistory.objects.create( + hall=hall, + caretaker=caretaker_staff, + batch=hall.assigned_batch, + warden=current_warden.faculty if( current_warden and current_warden.faculty) else None + ) + print("hostel hostory created succeessfully") + except Exception as e: + print ("Error creating history",e) + return Response({'message': f'Caretaker {caretaker_username} assigned to Hall {hall_id} successfully'}, status=status.HTTP_201_CREATED) + + except Hall.DoesNotExist: + return Response({'error': f'Hall with ID {hall_id} not found'}, status=status.HTTP_404_NOT_FOUND) + except Staff.DoesNotExist: + return Response({'error': f'Caretaker with username {caretaker_username} not found'}, status=status.HTTP_404_NOT_FOUND) + except Exception as e: + return JsonResponse({'status': 'error', 'error': str(e)}, status=500) + + +@method_decorator(user_passes_test(is_superuser), name='dispatch') +class AssignBatchView(View): + authentication_classes = [SessionAuthentication] + permission_classes = [IsAuthenticated] + # Assuming the HTML file is directly in the 'templates' folder + template_name = 'hostelmanagement/assign_batch.html' + + def get(self, request, *args, **kwargs): + hall = Hall.objects.all() + return render(request, self.template_name, {'halls': hall}) + + def post(self, request, *args, **kwargs): + try: + data = json.loads(request.body.decode('utf-8')) + hall_id = data.get('hall_id') + + hall = Hall.objects.get(hall_id=hall_id) + previous_batch = hall.assigned_batch # Get the previous batch + hall.assigned_batch = data.get('batch') + hall.save() + + # Update the assignedBatch field in HostelAllotment table for the corresponding hall + room_allotments = HostelAllotment.objects.filter(hall=hall) + for room_allotment in room_allotments: + room_allotment.assignedBatch = hall.assigned_batch + room_allotment.save() + + # retrieve the current caretaker and current warden for the hall + current_caretaker =HallCaretaker.objects.filter(hall=hall).first() + current_warden = HallWarden.objects.filter(hall=hall).first() + + # Record the transaction history + HostelTransactionHistory.objects.create( + hall=hall, + change_type='Batch', + previous_value=previous_batch, + new_value=hall.assigned_batch + ) + + # Create hostel history + try: + HostelHistory.objects.create( + hall=hall, + caretaker=current_caretaker.staff if (current_caretaker and current_caretaker.staff) else None, + + batch=hall.assigned_batch, + warden=current_warden.faculty if( current_warden and current_warden.faculty) else None + + ) + print("hostel hostory created succeessfully") + except Exception as e: + print ("Error creating history",e) + + return JsonResponse({'status': 'success', 'message': 'Batch assigned successfully'}, status=200) + + except Hall.DoesNotExist: + return JsonResponse({'status': 'error', 'error': f'Hall with ID {hall_id} not found'}, status=404) + + except Exception as e: + return JsonResponse({'status': 'error', 'error': str(e)}, status=500) + + def test_func(self): + # Check if the user is a superuser + return self.request.user.is_superuser + + +@method_decorator(user_passes_test(is_superuser), name='dispatch') +class AssignWardenView(APIView): + authentication_classes = [SessionAuthentication] + permission_classes = [IsAuthenticated] + template_name = 'hostelmanagement/assign_warden.html' + + def post(self, request, *args, **kwargs): + hall_id = request.data.get('hall_id') + warden_id = request.data.get('warden_id') + try: + hall = Hall.objects.get(hall_id=hall_id) + warden = Faculty.objects.get(id__user__username=warden_id) + + # Retrieve the previous caretaker for the hall, if any + prev_hall_warden = HallWarden.objects.filter(hall=hall).first() + + # Delete any previous assignments of the warden in Hallwarden table + HallWarden.objects.filter(faculty=warden).delete() + + # Delete any previous assignments of the warden in HostelAllotment table + HostelAllotment.objects.filter(assignedWarden=warden).delete() + + # Delete any previously assigned warden to the same hall + HallWarden.objects.filter(hall=hall).delete() + + # Assign the new warden to the hall in Hallwarden table + hall_warden = HallWarden.objects.create(hall=hall, faculty=warden) + + #current caretker + current_caretaker =HallCaretaker.objects.filter(hall=hall).first() + print(current_caretaker) + + # Update the assigned warden in Hostelallottment table + hostel_allotments = HostelAllotment.objects.filter(hall=hall) + for hostel_allotment in hostel_allotments: + hostel_allotment.assignedWarden = warden + hostel_allotment.save() + + print("Before creating HostelTransactionHistory") + try: + history_entry = HostelTransactionHistory.objects.create( + hall=hall, + change_type='Warden', + previous_value= prev_hall_warden.faculty.id if (prev_hall_warden and prev_hall_warden.faculty) else 'None', + new_value=warden + ) + print("HostelTransactionHistory created successfully") + except Exception as e: + print("Error creating HostelTransactionHistory:", e) + + + # Create hostel history + try: + HostelHistory.objects.create( + hall=hall, + caretaker=current_caretaker.staff if (current_caretaker and current_caretaker.staff) else None, + + batch=hall.assigned_batch, + warden=warden + ) + print("hostel hostory created succeessfully") + except Exception as e: + print ("Error creating history",e) + + + return Response({'message': f'Warden {warden_id} assigned to Hall {hall_id} successfully'}, status=status.HTTP_201_CREATED) + + except Hall.DoesNotExist: + return Response({'error': f'Hall with ID {hall_id} not found'}, status=status.HTTP_404_NOT_FOUND) + except Faculty.DoesNotExist: + return Response({'error': f'Warden with username {warden_id} not found'}, status=status.HTTP_404_NOT_FOUND) + except Exception as e: + return JsonResponse({'status': 'error', 'error': str(e)}, status=500) + + +@method_decorator(user_passes_test(is_superuser), name='dispatch') +class AddHostelView(View): + template_name = 'hostelmanagement/add_hostel.html' + + def get(self, request, *args, **kwargs): + form = HallForm() + return render(request, self.template_name, {'form': form}) + + def post(self, request, *args, **kwargs): + form = HallForm(request.POST) + if form.is_valid(): + hall_id = form.cleaned_data['hall_id'] + + # # Check if a hall with the given hall_id already exists + # if Hall.objects.filter(hall_id=hall_id).exists(): + # messages.error(request, f'Hall with ID {hall_id} already exists.') + # return redirect('hostelmanagement:add_hostel') + + # Check if a hall with the given hall_id already exists + if Hall.objects.filter(hall_id=hall_id).exists(): + error_message = f'Hall with ID {hall_id} already exists.' + + return HttpResponse(error_message, status=400) + + # If not, create a new hall + form.save() + messages.success(request, 'Hall added successfully!') + # Redirect to the view showing all hostels + return HttpResponseRedirect(reverse("hostelmanagement:hostel_view")) + # return render(request, 'hostelmanagement/admin_hostel_list.html') + + # If form is not valid, render the form with errors + return render(request, self.template_name, {'form': form}) + + +class CheckHallExistsView(View): + + def get(self, request, *args, **kwargs): + + hall_id = request.GET.get('hall_id') + try: + hall = Hall.objects.get(hall_id=hall_id) + exists = True + except Hall.DoesNotExist: + exists = False + messages.MessageFailure(request, f'Hall {hall_id} already exist.') + return JsonResponse({'exists': exists}) + + +@method_decorator(user_passes_test(is_superuser), name='dispatch') +class AdminHostelListView(View): + template_name = 'hostelmanagement/admin_hostel_list.html' + + def get(self, request, *args, **kwargs): + halls = Hall.objects.all() + # Create a list to store additional details + hostel_details = [] + + # Loop through each hall and fetch assignedCaretaker and assignedWarden + for hall in halls: + try: + caretaker = HallCaretaker.objects.filter(hall=hall).first() + warden = HallWarden.objects.filter(hall=hall).first() + except HostelAllotment.DoesNotExist: + assigned_caretaker = None + assigned_warden = None + + hostel_detail = { + 'hall_id': hall.hall_id, + 'hall_name': hall.hall_name, + 'max_accomodation': hall.max_accomodation, + 'number_students': hall.number_students, + 'assigned_batch': hall.assigned_batch, + 'assigned_caretaker': caretaker.staff.id.user.username if caretaker else None, + 'assigned_warden': warden.faculty.id.user.username if warden else None, + } + + hostel_details.append(hostel_detail) + + return render(request, self.template_name, {'hostel_details': hostel_details}) + + +@method_decorator(user_passes_test(is_superuser), name='dispatch') +class DeleteHostelView(View): + def get(self, request, hall_id, *args, **kwargs): + # Get the hall instance + hall = get_object_or_404(Hall, hall_id=hall_id) + + # Delete related entries in other tables + hostelallotments = HostelAllotment.objects.filter(hall=hall) + hostelallotments.delete() + + # Delete the hall + hall.delete() + messages.success(request, f'Hall {hall_id} deleted successfully.') + + return HttpResponseRedirect(reverse("hostelmanagement:hostel_view")) + + +class HallIdView(APIView): + authentication_classes = [] # Allow public access for testing + permission_classes = [] # Allow any user to access the view + + def get(self, request, *args, **kwargs): + hall_id = HostelAllotment.objects.values('hall_id') + return Response(hall_id, status=status.HTTP_200_OK) + + +@login_required(login_url=LOGIN_URL) +def logout_view(request): + logout(request) + return redirect("/") + + +# //! alloted_rooms +def alloted_rooms(request, hall_id): + """ + This function returns the allotted rooms in a particular hall. + + @param: + request - HttpRequest object containing metadata about the user request. + hall_id - Hall ID for which the allotted rooms need to be retrieved. + + @variables: + allotted_rooms - stores all the rooms allotted in the given hall. + """ + # Query the hall by hall_id + hall = Hall.objects.get(hall_id=hall_id) + # Query all rooms allotted in the given hall + allotted_rooms = HallRoom.objects.filter(hall=hall, room_occupied__gt=0) + # Prepare a list of room details to be returned + room_details = [] + for room in allotted_rooms: + room_details.append({ + 'hall': room.hall.hall_id, + 'room_no': room.room_no, + 'block_no': room.block_no, + 'room_cap': room.room_cap, + 'room_occupied': room.room_occupied + }) + return JsonResponse(room_details, safe=False) + + +def alloted_rooms_main(request): + """ + This function returns the allotted rooms in all halls. + + @param: + request - HttpRequest object containing metadata about the user request. + + @variables: + all_halls - stores all the halls. + all_rooms - stores all the rooms allotted in all halls. + """ + # Query all halls + all_halls = Hall.objects.all() + + # Query all rooms allotted in all halls + all_rooms = [] + for hall in all_halls: + all_rooms.append(HallRoom.objects.filter( + hall=hall, room_occupied__gt=0)) + + # Prepare a list of room details to be returned + room_details = [] + for rooms in all_rooms: + for room in rooms: + room_details.append({ + 'hall': room.hall.hall_name, + 'room_no': room.room_no, + 'block_no': room.block_no, + 'room_cap': room.room_cap, + 'room_occupied': room.room_occupied + }) + + # Return the room_details as JSON response + return render(request, 'hostelmanagement/alloted_rooms_main.html', {'allotted_rooms': room_details, 'halls': all_halls}) + + +# //! all_staff +def all_staff(request, hall_id): + """ + This function returns all staff information for a specific hall. + + @param: + request - HttpRequest object containing metadata about the user request. + hall_id - The ID of the hall for which staff information is requested. + + + @variables: + all_staff - stores all staff information for the specified hall. + """ + + # Query all staff information for the specified hall + all_staff = StaffSchedule.objects.filter(hall_id=hall_id) + + # Prepare a list of staff details to be returned + staff_details = [] + for staff in all_staff: + staff_details.append({ + 'type': staff.staff_type, + 'staff_id': staff.staff_id_id, + 'hall_id': staff.hall_id, + 'day': staff.day, + 'start_time': staff.start_time, + 'end_time': staff.end_time + }) + + # Return the staff_details as JSON response + return JsonResponse(staff_details, safe=False) + + +# //! Edit Stuff schedule +class StaffScheduleView(APIView): + """ + API endpoint for creating or editing staff schedules. + """ + + authentication_classes = [] # Allow public access for testing + permission_classes = [] # Allow any user to access the view + + def patch(self, request, staff_id): + staff = get_object_or_404(Staff, pk=staff_id) + staff_type = request.data.get('staff_type') + start_time = request.data.get('start_time') + end_time = request.data.get('end_time') + day = request.data.get('day') + + # print(staff_id, start_time, end_time, day) + + if start_time and end_time and day and staff_type: + # Check if staff schedule exists for the given day + existing_schedule = StaffSchedule.objects.filter( + staff_id=staff_id).first() + # print(existing_schedule) + if existing_schedule: + existing_schedule.start_time = start_time + existing_schedule.end_time = end_time + existing_schedule.day = day + existing_schedule.staff_type = staff_type + existing_schedule.save() + return Response({"message": "Staff schedule updated successfully."}, status=status.HTTP_200_OK) + else: + # If staff schedule doesn't exist for the given day, return 404 + return Response({"error": "Staff schedule does not exist for the given day."}, status=status.HTTP_404_NOT_FOUND) + + return Response({"error": "Please provide start_time, end_time, and day."}, status=status.HTTP_400_BAD_REQUEST) + + +# //! Hostel Inventory + +@login_required +def get_inventory_form(request): + user_id = request.user + # print("user_id",user_id) + staff = user_id.extrainfo.id + # print("staff",staff) + + # Check if the user is present in the HallCaretaker table + if HallCaretaker.objects.filter(staff_id=staff).exists(): + # If the user is a caretaker, allow access + halls = Hall.objects.all() + return render(request, 'hostelmanagement/inventory_form.html', {'halls': halls}) + else: + # If the user is not a caretaker, redirect to the login page + # return redirect('login') # Adjust 'login' to your login URL name + return HttpResponse(f'') + + +@login_required +def edit_inventory(request, inventory_id): + # Retrieve hostel inventory object + inventory = get_object_or_404(HostelInventory, pk=inventory_id) + + # Check if the user is a caretaker + user_id = request.user + staff_id = user_id.extrainfo.id + + if HallCaretaker.objects.filter(staff_id=staff_id).exists(): + halls = Hall.objects.all() + + # Prepare inventory data for rendering + inventory_data = { + 'inventory_id': inventory.inventory_id, + 'hall_id': inventory.hall_id, + 'inventory_name': inventory.inventory_name, + 'cost': str(inventory.cost), # Convert DecimalField to string + 'quantity': inventory.quantity, + } + + # Render the inventory update form with inventory data + return render(request, 'hostelmanagement/inventory_update_form.html', {'inventory': inventory_data, 'halls': halls}) + else: + # If the user is not a caretaker, show a message and redirect + return HttpResponse('') + + +class HostelInventoryUpdateView(APIView): + authentication_classes = [SessionAuthentication] + permission_classes = [IsAuthenticated] + + @method_decorator(login_required) + def dispatch(self, *args, **kwargs): + return super().dispatch(*args, **kwargs) + + def post(self, request, inventory_id): + user_id = request.user + staff_id = user_id.extrainfo.id + + if not HallCaretaker.objects.filter(staff_id=staff_id).exists(): + return Response({'error': 'You are not authorized to update this hostel inventory'}, status=status.HTTP_401_UNAUTHORIZED) + + hall_id = request.data.get('hall_id') + inventory_name = request.data.get('inventory_name') + cost = request.data.get('cost') + quantity = request.data.get('quantity') + + # Validate required fields + if not all([hall_id, inventory_name, cost, quantity]): + return Response({'error': 'All fields are required'}, status=status.HTTP_400_BAD_REQUEST) + + # Retrieve hostel inventory object + hostel_inventory = get_object_or_404(HostelInventory, pk=inventory_id) + + # Update hostel inventory object + hostel_inventory.hall_id = hall_id + hostel_inventory.inventory_name = inventory_name + hostel_inventory.cost = cost + hostel_inventory.quantity = quantity + hostel_inventory.save() + + # Return success response + return Response({'message': 'Hostel inventory updated successfully'}, status=status.HTTP_200_OK) + + +class HostelInventoryView(APIView): + """ + API endpoint for CRUD operations on hostel inventory. + """ + # permission_classes = [IsAuthenticated] + + # authentication_classes = [] # Allow public access for testing + # permission_classes = [] # Allow any user to access the view + + authentication_classes = [SessionAuthentication] + permission_classes = [IsAuthenticated] + + @method_decorator(login_required) + def dispatch(self, *args, **kwargs): + return super().dispatch(*args, **kwargs) + + def get(self, request, hall_id): + user_id = request.user + staff_id = user_id.extrainfo.id + + if not HallCaretaker.objects.filter(staff_id=staff_id).exists(): + return HttpResponse('') + + # Retrieve hostel inventory objects for the given hall ID + inventories = HostelInventory.objects.filter(hall_id=hall_id) + + # Get all hall IDs + halls = Hall.objects.all() + + # Serialize inventory data + inventory_data = [] + for inventory in inventories: + inventory_data.append({ + 'inventory_id': inventory.inventory_id, + 'hall_id': inventory.hall_id, + 'inventory_name': inventory.inventory_name, + 'cost': str(inventory.cost), # Convert DecimalField to string + 'quantity': inventory.quantity, + }) + + inventory_data.sort(key=lambda x: x['inventory_id']) + + # Return inventory data as JSON response + return render(request, 'hostelmanagement/inventory_list.html', {'halls': halls, 'inventories': inventory_data}) + + def post(self, request): + user_id = request.user + staff_id = user_id.extrainfo.id + + if not HallCaretaker.objects.filter(staff_id=staff_id).exists(): + return Response({'error': 'You are not authorized to create a new hostel inventory'}, status=status.HTTP_401_UNAUTHORIZED) + + # Extract data from request + hall_id = request.data.get('hall_id') + inventory_name = request.data.get('inventory_name') + cost = request.data.get('cost') + quantity = request.data.get('quantity') + + # Validate required fields + if not all([hall_id, inventory_name, cost, quantity]): + return Response({'error': 'All fields are required'}, status=status.HTTP_400_BAD_REQUEST) + + # Create hostel inventory object + try: + hostel_inventory = HostelInventory.objects.create( + hall_id=hall_id, + inventory_name=inventory_name, + cost=cost, + quantity=quantity + ) + return Response({'message': 'Hostel inventory created successfully', 'hall_id': hall_id}, status=status.HTTP_201_CREATED) + except Exception as e: + return Response({'error': str(e)}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) + + def delete(self, request, inventory_id): + user_id = request.user + staff_id = user_id.extrainfo.id + + if not HallCaretaker.objects.filter(staff_id=staff_id).exists(): + return Response({'error': 'You are not authorized to delete this hostel inventory'}, status=status.HTTP_401_UNAUTHORIZED) + + inventory = get_object_or_404(HostelInventory, pk=inventory_id) + inventory.delete() + return Response({'message': 'Hostel inventory deleted successfully'}, status=status.HTTP_204_NO_CONTENT) + + +def update_allotment(request, pk): + if request.method == 'POST': + try: + allotment = HostelAllottment.objects.get(pk=pk) + except HostelAllottment.DoesNotExist: + return JsonResponse({'error': 'HostelAllottment not found'}, status=404) + + try: + allotment.assignedWarden = Faculty.objects.get( + id=request.POST['warden_id']) + allotment.assignedCaretaker = Staff.objects.get( + id=request.POST['caretaker_id']) + allotment.assignedBatch = request.POST.get( + 'student_batch', allotment.assignedBatch) + allotment.save() + return JsonResponse({'success': 'HostelAllottment updated successfully'}) + except (Faculty.DoesNotExist, Staff.DoesNotExist, IntegrityError): + return JsonResponse({'error': 'Invalid data or integrity error'}, status=400) + + return JsonResponse({'error': 'Invalid request method'}, status=405) + + +@login_required +def request_guest_room(request): + """ + This function is used by the student to book a guest room. + @param: + request - HttpRequest object containing metadata about the user request. + """ + print("Inside book guest room") + if request.method == "POST": + form = GuestRoomBookingForm(request.POST) + + if form.is_valid(): + # print("Inside valid") + hall = form.cleaned_data['hall'] + guest_name = form.cleaned_data['guest_name'] + guest_phone = form.cleaned_data['guest_phone'] + guest_email = form.cleaned_data['guest_email'] + guest_address = form.cleaned_data['guest_address'] + rooms_required = form.cleaned_data['rooms_required'] + total_guest = form.cleaned_data['total_guest'] + purpose = form.cleaned_data['purpose'] + arrival_date = form.cleaned_data['arrival_date'] + arrival_time = form.cleaned_data['arrival_time'] + departure_date = form.cleaned_data['departure_date'] + departure_time = form.cleaned_data['departure_time'] + nationality = form.cleaned_data['nationality'] + + newBooking = GuestRoomBooking.objects.create(hall=hall, intender=request.user, guest_name=guest_name, guest_address=guest_address, + guest_phone=guest_phone, guest_email=guest_email, rooms_required=rooms_required, total_guest=total_guest, purpose=purpose, + arrival_date=arrival_date, arrival_time=arrival_time, departure_date=departure_date, departure_time=departure_time, nationality=nationality) + newBooking.save() + messages.success(request, "Room request submitted successfully!") + + + # Get the caretaker for the selected hall + hall_caretaker = HallCaretaker.objects.get(hall=hall) + caretaker = hall_caretaker.staff.id.user + # Send notification to caretaker + hostel_notifications(sender=request.user, recipient=caretaker, type='guestRoom_request') + + return HttpResponseRedirect(reverse("hostelmanagement:hostel_view")) + else: + messages.error(request, "Something went wrong") + return HttpResponseRedirect(reverse("hostelmanagement:hostel_view")) + + +@login_required +def update_guest_room(request): + if request.method == "POST": + if 'accept_request' in request.POST: + status = request.POST['status'] + guest_room_request = GuestRoomBooking.objects.get( + pk=request.POST['accept_request']) + guest_room_instance = GuestRoom.objects.get( + hall=guest_room_request.hall, room=request.POST['guest_room_id']) + + # Assign the guest room ID to guest_room_id field + guest_room_request.guest_room_id = str(guest_room_instance.id) + + # Update the assigned guest room's occupancy details + guest_room_instance.occupied_till = guest_room_request.departure_date + guest_room_instance.vacant = False # Mark the room as occupied + guest_room_instance.save() + + # Update the occupied_till field of the room_booked + room_booked = GuestRoom.objects.get( + hall=guest_room_request.hall, room=request.POST['guest_room_id']) + room_booked.occupied_till = guest_room_request.departure_date + room_booked.save() + + # Save the guest room request after updating the fields + guest_room_request.status = status + guest_room_request.save() + messages.success(request, "Request accepted successfully!") + + hostel_notifications(sender=request.user,recipient=guest_room_request.intender,type='guestRoom_accept') + + + elif 'reject_request' in request.POST: + guest_room_request = GuestRoomBooking.objects.get( + pk=request.POST['reject_request']) + guest_room_request.status = 'Rejected' + guest_room_request.save() + + messages.success(request, "Request rejected successfully!") + + hostel_notifications(sender=request.user,recipient=guest_room_request.intender,type='guestRoom_reject') + + else: + messages.error(request, "Invalid request!") + return HttpResponseRedirect(reverse("hostelmanagement:hostel_view")) + + +# //Caretaker can approve or reject leave applied by the student +@csrf_exempt +def update_leave_status(request): + if request.method == 'POST': + leave_id = request.POST.get('leave_id') + status = request.POST.get('status') + try: + leave = HostelLeave.objects.get(id=leave_id) + leave.status = status + leave.remark = request.POST.get('remark') + leave.save() + + # Send notification to the student + sender = request.user # Assuming request.user is the caretaker + + student_id = leave.roll_num # Assuming student is a foreign key field in HostelLeave model + recipient = User.objects.get(username=student_id) + type = "leave_accept" if status == "Approved" else "leave_reject" + hostel_notifications(sender, recipient, type) + + return JsonResponse({'status': status,'remarks':leave.remark,'message': 'Leave status updated successfully.'}) + except HostelLeave.DoesNotExist: + return JsonResponse({'status': 'error', 'message': 'Leave not found.'}, status=404) + else: + return JsonResponse({'status': 'error', 'message': 'Only POST requests are allowed.'}, status=405) + + +# //! Manage Fine +# //! Add Fine Functionality + + +@login_required +def impose_fine_view(request): + user_id = request.user + staff = user_id.extrainfo.id + students = Student.objects.all() + + if HallCaretaker.objects.filter(staff_id=staff).exists(): + return render(request, 'hostelmanagement/impose_fine.html', {'students': students}) + + return HttpResponse(f'') + + +class HostelFineView(APIView): + """ + API endpoint for imposing fines on students. + """ + authentication_classes = [SessionAuthentication] + permission_classes = [IsAuthenticated] + + @method_decorator(login_required) + def dispatch(self, *args, **kwargs): + return super().dispatch(*args, **kwargs) + + def post(self, request): + # Check if the user is a caretaker + user_id = request.user + staff = user_id.extrainfo.id + + try: + caretaker = HallCaretaker.objects.get(staff_id=staff) + except HallCaretaker.DoesNotExist: + return HttpResponse(f'') + + hall_id = caretaker.hall_id + + # Extract data from the request + student_id = request.data.get('student_id') + student_name = request.data.get('student_fine_name') + amount = request.data.get('amount') + reason = request.data.get('reason') + + # Validate the data + if not all([student_id, student_name, amount, reason]): + return HttpResponse({'error': 'Incomplete data provided.'}, status=status.HTTP_400_BAD_REQUEST) + + # Create the HostelFine object + try: + fine = HostelFine.objects.create( + student_id=student_id, + student_name=student_name, + amount=amount, + reason=reason, + hall_id=hall_id + ) + # Sending notification to the student about the imposed fine + + + + recipient = User.objects.get(username=student_id) + + sender = request.user + + type = "fine_imposed" + hostel_notifications(sender, recipient, type) + + return HttpResponse({'message': 'Fine imposed successfully.'}, status=status.HTTP_201_CREATED) + except Exception as e: + return Response({'error': str(e)}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) + + +@login_required +def get_student_name(request, username): + try: + user = User.objects.get(username=username) + full_name = f"{user.first_name} {user.last_name}" if user.first_name or user.last_name else "" + return JsonResponse({"name": full_name}) + except User.DoesNotExist: + return JsonResponse({"error": "User not found"}, status=404) + + +@login_required +def hostel_fine_list(request): + user_id = request.user + staff = user_id.extrainfo.id + caretaker = HallCaretaker.objects.get(staff_id=staff) + hall_id = caretaker.hall_id + hostel_fines = HostelFine.objects.filter( + hall_id=hall_id).order_by('fine_id') + + if HallCaretaker.objects.filter(staff_id=staff).exists(): + return render(request, 'hostelmanagement/hostel_fine_list.html', {'hostel_fines': hostel_fines}) + + return HttpResponse(f'') + + +@login_required +def student_fine_details(request): + user_id = request.user.username + # print(user_id) + # staff=user_id.extrainfo.id + + # Check if the user_id exists in the Student table + # if HallCaretaker.objects.filter(staff_id=staff).exists(): + # return HttpResponse('') + + if not Student.objects.filter(id_id=user_id).exists(): + return HttpResponse('') + + # # Check if the user_id exists in the HostelFine table + if not HostelFine.objects.filter(student_id=user_id).exists(): + return HttpResponse('') + + # # Retrieve the fines associated with the current student + student_fines = HostelFine.objects.filter(student_id=user_id) + + return render(request, 'hostelmanagement/student_fine_details.html', {'student_fines': student_fines}) + + # return JsonResponse({'message': 'Nice'}, status=status.HTTP_200_OK) + + +class HostelFineUpdateView(APIView): + authentication_classes = [SessionAuthentication] + permission_classes = [IsAuthenticated] + + @method_decorator(login_required) + def dispatch(self, *args, **kwargs): + return super().dispatch(*args, **kwargs) + + def post(self, request, fine_id): + user_id = request.user + staff = user_id.extrainfo.id + + data = request.data + fine_idd = data.get('fine_id') + status_ = data.get('status') + # print("fine_idd",fine_idd) + # print("status_",status_) + + try: + caretaker = HallCaretaker.objects.get(staff_id=staff) + except HallCaretaker.DoesNotExist: + return Response({'error': 'You are not authorized to access this page'}, status=status.HTTP_403_FORBIDDEN) + + hall_id = caretaker.hall_id + + # Convert fine_id to integer + fine_id = int(fine_id) + + # Get hostel fine object + try: + hostel_fine = HostelFine.objects.get( + hall_id=hall_id, fine_id=fine_id) + except HostelFine.DoesNotExist: + raise NotFound(detail="Hostel fine not found") + + # Validate required fields + if status_ not in ['Pending', 'Paid']: + return Response({'error': 'Invalid status value'}, status=status.HTTP_400_BAD_REQUEST) + + # # Update status of the hostel fine + hostel_fine.status = status_ + hostel_fine.save() + + # Return success response + return Response({'message': 'Hostel fine status updated successfully!'}, status=status.HTTP_200_OK) + + def delete(self, request, fine_id): + user_id = request.user + staff = user_id.extrainfo.id + + try: + caretaker = HallCaretaker.objects.get(staff_id=staff) + except HallCaretaker.DoesNotExist: + return Response({'error': 'You are not authorized to access this page'}, status=status.HTTP_403_FORBIDDEN) + + hall_id = caretaker.hall_id + + # Convert fine_id to integer + fine_id = int(fine_id) + + # Get hostel fine object + try: + hostel_fine = HostelFine.objects.get( + hall_id=hall_id, fine_id=fine_id) + hostel_fine.delete() + except HostelFine.DoesNotExist: + raise NotFound(detail="Hostel fine not found") + + return Response({'message': 'Fine deleted successfully.'}, status=status.HTTP_204_NO_CONTENT) diff --git a/FusionIIIT/applications/hr2/.DS_Store b/FusionIIIT/applications/hr2/.DS_Store new file mode 100644 index 000000000..b7c627ee8 Binary files /dev/null and b/FusionIIIT/applications/hr2/.DS_Store differ diff --git a/FusionIIIT/applications/hr2/migrations/0001_initial.py b/FusionIIIT/applications/hr2/migrations/0001_initial.py deleted file mode 100644 index 83b197c8f..000000000 --- a/FusionIIIT/applications/hr2/migrations/0001_initial.py +++ /dev/null @@ -1,91 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('globals', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='WorkAssignemnt', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('start_date', models.DateField(blank=True, max_length=6, null=True)), - ('end_date', models.DateField(blank=True, max_length=6, null=True)), - ('job_title', models.CharField(default='', max_length=50)), - ('orders_copy', models.FileField(blank=True, null=True, upload_to='')), - ('extra_info', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='ForeignService', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('start_date', models.DateField(blank=True, max_length=6, null=True)), - ('end_date', models.DateField(blank=True, max_length=6, null=True)), - ('job_title', models.CharField(default='', max_length=50)), - ('organisation', models.CharField(default='', max_length=100)), - ('description', models.CharField(default='', max_length=300)), - ('salary_source', models.CharField(default='', max_length=100)), - ('designation', models.CharField(default='', max_length=100)), - ('service_type', models.CharField(choices=[('LIEN', 'LIEN'), ('DEPUTATION', 'DEPUTATION'), ('OTHER', 'OTHER')], max_length=100)), - ('extra_info', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='Employee', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('father_name', models.CharField(default='', max_length=40)), - ('mother_name', models.CharField(default='', max_length=40)), - ('religion', models.CharField(default='', max_length=40)), - ('category', models.CharField(choices=[('SC', 'SC'), ('ST', 'ST'), ('OBC', 'OBC'), ('GENERAL', 'GENERAL'), ('PWD', 'PWD')], max_length=50)), - ('cast', models.CharField(default='', max_length=40)), - ('home_state', models.CharField(default='', max_length=40)), - ('home_district', models.CharField(default='', max_length=40)), - ('date_of_joining', models.DateField(blank=True, null=True)), - ('designation', models.CharField(default='', max_length=40)), - ('blood_group', models.CharField(choices=[('AB+', 'AB+'), ('O+', 'O+'), ('AB-', 'AB-'), ('B+', 'B+'), ('B-', 'B-'), ('O-', 'O-'), ('A+', 'A+'), ('A-', 'A-')], max_length=50)), - ('extra_info', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='EmpDependents', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(default='', max_length=100)), - ('gender', models.CharField(choices=[('M', 'Male'), ('F', 'Female'), ('O', 'Other')], max_length=50)), - ('dob', models.DateField(max_length=6, null=True)), - ('relationship', models.CharField(default='', max_length=40)), - ('extra_info', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='EmpConfidentialDetails', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('aadhar_no', models.BigIntegerField(default=0, max_length=12, validators=[django.core.validators.MaxValueValidator(999999999999), django.core.validators.MinValueValidator(99999999999)])), - ('maritial_status', models.CharField(choices=[('MARRIED', 'MARRIED'), ('UN-MARRIED', 'UN-MARRIED'), ('WIDOW', 'WIDOW')], max_length=50)), - ('bank_account_no', models.IntegerField(default=0)), - ('salary', models.IntegerField(default=0)), - ('extra_info', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='EmpAppraisalForm', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('year', models.DateField(blank=True, max_length=6, null=True)), - ('appraisal_form', models.FileField(default=' ', null=True, upload_to='Hr2/appraisal_form')), - ('extra_info', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - ] diff --git a/FusionIIIT/applications/hr2/migrations/__init__.py b/FusionIIIT/applications/hr2/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/income_expenditure/.DS_Store b/FusionIIIT/applications/income_expenditure/.DS_Store new file mode 100644 index 000000000..b7c627ee8 Binary files /dev/null and b/FusionIIIT/applications/income_expenditure/.DS_Store differ diff --git a/FusionIIIT/applications/income_expenditure/migrations/0001_initial.py b/FusionIIIT/applications/income_expenditure/migrations/0001_initial.py deleted file mode 100644 index 1501efdb9..000000000 --- a/FusionIIIT/applications/income_expenditure/migrations/0001_initial.py +++ /dev/null @@ -1,80 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='BalanceSheet', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('balanceSheet', models.FileField(upload_to='')), - ('date_added', models.CharField(max_length=10)), - ], - ), - migrations.CreateModel( - name='ExpenditureType', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('expenditure_type', models.CharField(max_length=100)), - ], - ), - migrations.CreateModel( - name='FixedAttributes', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('attribute', models.CharField(max_length=100)), - ('value', models.IntegerField(default=0)), - ], - ), - migrations.CreateModel( - name='IncomeSource', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('income_source', models.CharField(max_length=100)), - ], - ), - migrations.CreateModel( - name='otherExpense', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('spent_on', models.CharField(max_length=100)), - ('status', models.CharField(max_length=20)), - ('name', models.CharField(max_length=30)), - ('userid', models.CharField(max_length=10)), - ('amount', models.IntegerField()), - ('date_added', models.DateField()), - ('remarks', models.CharField(blank=True, max_length=100)), - ], - ), - migrations.CreateModel( - name='Income', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('amount', models.IntegerField()), - ('date_added', models.DateField()), - ('remarks', models.CharField(blank=True, max_length=100)), - ('receipt', models.FileField(blank=True, upload_to='iemodule/income_receipts')), - ('source', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='incomeSource', to='income_expenditure.incomesource')), - ], - ), - migrations.CreateModel( - name='Expenditure', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('amount', models.IntegerField()), - ('date_added', models.DateField()), - ('remarks', models.CharField(max_length=100)), - ('expenditure_receipt', models.FileField(upload_to='iemodule/expenditure_receipts')), - ('spent_on', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='expenditureType', to='income_expenditure.expendituretype')), - ], - ), - ] diff --git a/FusionIIIT/applications/income_expenditure/migrations/__init__.py b/FusionIIIT/applications/income_expenditure/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/iwdModuleV2/.DS_Store b/FusionIIIT/applications/iwdModuleV2/.DS_Store new file mode 100644 index 000000000..3f41f8382 Binary files /dev/null and b/FusionIIIT/applications/iwdModuleV2/.DS_Store differ diff --git a/FusionIIIT/applications/iwdModuleV2/migrations/0001_initial.py b/FusionIIIT/applications/iwdModuleV2/migrations/0001_initial.py deleted file mode 100644 index bbde8386c..000000000 --- a/FusionIIIT/applications/iwdModuleV2/migrations/0001_initial.py +++ /dev/null @@ -1,226 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='FinancialBidDetails', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('sNo', models.CharField(max_length=200)), - ('description', models.CharField(max_length=200)), - ], - ), - migrations.CreateModel( - name='Projects', - fields=[ - ('id', models.CharField(max_length=200, primary_key=True, serialize=False)), - ], - ), - migrations.CreateModel( - name='PageOneDetails', - fields=[ - ('id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='iwdModuleV2.projects')), - ('aESFile', models.FileField(null=True, upload_to='')), - ('dASA', models.DateField(null=True)), - ('nitNiqNo', models.IntegerField(null=True)), - ('proTh', models.CharField(max_length=200, null=True)), - ('emdDetails', models.CharField(max_length=200, null=True)), - ('preBidDate', models.DateField(max_length=200, null=True)), - ('technicalBidDate', models.DateField(null=True)), - ('financialBidDate', models.DateField(null=True)), - ], - ), - migrations.CreateModel( - name='PageThreeDetails', - fields=[ - ('id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='iwdModuleV2.projects')), - ('extensionOfTime', models.FileField(upload_to='')), - ('actualCostOfBuilding', models.IntegerField()), - ], - ), - migrations.CreateModel( - name='PageTwoDetails', - fields=[ - ('id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='iwdModuleV2.projects')), - ('corrigendum', models.FileField(null=True, upload_to='')), - ('addendum', models.FileField(null=True, upload_to='')), - ('preBidMeetingDetails', models.FileField(null=True, upload_to='')), - ('technicalBidMeetingDetails', models.FileField(null=True, upload_to='')), - ('technicallyQualifiedAgencies', models.CharField(max_length=200, null=True)), - ('financialBidMeetingDetails', models.FileField(null=True, upload_to='')), - ('nameOfLowestAgency', models.CharField(max_length=200, null=True)), - ('letterOfIntent', models.FileField(null=True, upload_to='')), - ('workOrder', models.FileField(null=True, upload_to='')), - ('agreementLetter', models.FileField(null=True, upload_to='')), - ('milestones', models.FileField(null=True, upload_to='')), - ], - ), - migrations.CreateModel( - name='WorkOrderForm', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('issueDate', models.DateField()), - ('nitNiqNo', models.IntegerField()), - ('agency', models.CharField(max_length=200)), - ('name', models.CharField(max_length=200)), - ('amount', models.IntegerField()), - ('time', models.IntegerField()), - ('monthDay', models.IntegerField()), - ('startDate', models.DateField()), - ('completionDate', models.DateField()), - ('deposit', models.IntegerField()), - ('contractDay', models.IntegerField()), - ('key', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects', unique=True)), - ], - ), - migrations.CreateModel( - name='TechnicalBidDetails', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('sNo', models.CharField(max_length=200)), - ('requirements', models.CharField(max_length=200)), - ('key', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects', unique=True)), - ], - ), - migrations.CreateModel( - name='TechnicalBidContractorDetails', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=200)), - ('description', models.CharField(max_length=200)), - ('key', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.technicalbiddetails')), - ], - ), - migrations.CreateModel( - name='PreBidDetails', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('sNo', models.CharField(max_length=200)), - ('nameOfParticipants', models.CharField(max_length=200)), - ('issuesRaised', models.CharField(max_length=200)), - ('responseDecision', models.CharField(max_length=200)), - ('key', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects', unique=True)), - ], - ), - migrations.CreateModel( - name='NoOfTechnicalBidTimes', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('number', models.IntegerField()), - ('key', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects', unique=True)), - ], - ), - migrations.CreateModel( - name='Milestones', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('sNo', models.CharField(max_length=200)), - ('description', models.CharField(max_length=200)), - ('timeAllowed', models.IntegerField()), - ('amountWithheld', models.IntegerField()), - ('key', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects')), - ], - ), - migrations.CreateModel( - name='LetterOfIntentDetails', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('nitNiqNo', models.IntegerField()), - ('dateOfOpening', models.DateField()), - ('agency', models.CharField(max_length=200)), - ('name', models.CharField(max_length=200)), - ('tenderValue', models.IntegerField()), - ('key', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects', unique=True)), - ], - ), - migrations.CreateModel( - name='FinancialContractorDetails', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=200)), - ('estimatedCost', models.IntegerField()), - ('percentageRelCost', models.IntegerField()), - ('perFigures', models.IntegerField()), - ('totalCost', models.IntegerField()), - ('key', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.financialbiddetails')), - ], - ), - migrations.AddField( - model_name='financialbiddetails', - name='key', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects', unique=True), - ), - migrations.CreateModel( - name='ExtensionOfTimeDetails', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('sNo', models.CharField(max_length=200)), - ('hindrance', models.CharField(max_length=200)), - ('periodOfHindrance', models.IntegerField()), - ('periodOfExtension', models.IntegerField()), - ('key', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects')), - ], - ), - migrations.CreateModel( - name='CorrigendumTable', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('issueDate', models.DateField()), - ('nitNo', models.IntegerField()), - ('name', models.CharField(max_length=200)), - ('lastDate', models.DateField(null=True)), - ('lastTime', models.TimeField()), - ('env1BidOpeningDate', models.DateField()), - ('env1BidOpeningTime', models.TimeField()), - ('env2BidOpeningDate', models.DateField()), - ('env2BidOpeningTime', models.TimeField()), - ('key', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects', unique=True)), - ], - ), - migrations.CreateModel( - name='Agreement', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date', models.DateField()), - ('agencyName', models.CharField(max_length=200)), - ('workName', models.CharField(max_length=200)), - ('fdrSum', models.IntegerField()), - ('key', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects', unique=True)), - ], - ), - migrations.CreateModel( - name='AESDetails', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('sNo', models.CharField(max_length=100)), - ('descOfItems', models.CharField(max_length=200)), - ('unit', models.CharField(max_length=200)), - ('quantity', models.IntegerField()), - ('rate', models.IntegerField()), - ('amount', models.IntegerField()), - ('key', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects')), - ], - ), - migrations.CreateModel( - name='Addendum', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('issueDate', models.DateField()), - ('nitNiqNo', models.IntegerField()), - ('name', models.CharField(max_length=200)), - ('openDate', models.DateField()), - ('openTime', models.TimeField()), - ('key', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='iwdModuleV2.projects', unique=True)), - ], - ), - ] diff --git a/FusionIIIT/applications/iwdModuleV2/migrations/__init__.py b/FusionIIIT/applications/iwdModuleV2/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/leave/.DS_Store b/FusionIIIT/applications/leave/.DS_Store new file mode 100644 index 000000000..276d97bb4 Binary files /dev/null and b/FusionIIIT/applications/leave/.DS_Store differ diff --git a/FusionIIIT/applications/leave/migrations/0001_initial.py b/FusionIIIT/applications/leave/migrations/0001_initial.py deleted file mode 100644 index d9ce4e044..000000000 --- a/FusionIIIT/applications/leave/migrations/0001_initial.py +++ /dev/null @@ -1,169 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('globals', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='ClosedHoliday', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date', models.DateField()), - ], - ), - migrations.CreateModel( - name='Leave', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('purpose', models.CharField(blank=True, default='', max_length=500)), - ('status', models.CharField(choices=[('pending', 'Pending'), ('accepted', 'Accepted'), ('rejected', 'Rejected'), ('forwarded', 'Forwarded'), ('auto rejected', 'Auto Rejected')], default='pending', max_length=20)), - ('timestamp', models.DateTimeField(auto_now=True, null=True)), - ('extra_info', models.CharField(blank=True, default='', max_length=200, null=True)), - ('applicant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='all_leaves', to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='LeaveOffline', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('purpose', models.CharField(blank=True, default='', max_length=500)), - ('timestamp', models.DateTimeField(auto_now=True, null=True)), - ('application_date', models.DateField()), - ('applicant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='all_leaves_offline', to=settings.AUTH_USER_MODEL)), - ('leave_user_select', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='LeaveType', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=40)), - ('max_in_year', models.IntegerField(default=2)), - ('requires_proof', models.BooleanField(default=False)), - ('authority_forwardable', models.BooleanField(default=False)), - ('for_faculty', models.BooleanField(default=True)), - ('for_staff', models.BooleanField(default=True)), - ('for_student', models.BooleanField(default=False)), - ('requires_address', models.BooleanField(default=False)), - ], - ), - migrations.CreateModel( - name='RestrictedHoliday', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date', models.DateField()), - ], - ), - migrations.CreateModel( - name='VacationHoliday', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date', models.DateField()), - ], - ), - migrations.CreateModel( - name='ReplacementSegmentOffline', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('replacement_type', models.CharField(choices=[('academic', 'Academic Replacement'), ('administrative', 'Administrative Replacement')], default='academic', max_length=20)), - ('start_date', models.DateField()), - ('end_date', models.DateField()), - ('leave', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='replace_segments_offline', to='leave.leaveoffline')), - ('replacer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rep_requests_offline', to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='ReplacementSegment', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('replacement_type', models.CharField(choices=[('academic', 'Academic Replacement'), ('administrative', 'Administrative Replacement')], default='academic', max_length=20)), - ('start_date', models.DateField()), - ('end_date', models.DateField()), - ('status', models.CharField(choices=[('pending', 'Pending'), ('accepted', 'Accepted'), ('rejected', 'Rejected'), ('forwarded', 'Forwarded'), ('auto rejected', 'Auto Rejected')], default='pending', max_length=20)), - ('remark', models.CharField(blank=True, default='', max_length=50, null=True)), - ('leave', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='replace_segments', to='leave.leave')), - ('replacer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rep_requests', to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='LeaveSegmentOffline', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('document', models.FileField(null=True, upload_to='leave/leave_documents/')), - ('start_date', models.DateField()), - ('start_half', models.BooleanField(default=False)), - ('end_date', models.DateField()), - ('end_half', models.BooleanField(default=False)), - ('address', models.CharField(blank=True, default='', max_length=500, null=True)), - ('leave', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='segments_offline', to='leave.leaveoffline')), - ('leave_type', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='leave.leavetype')), - ], - ), - migrations.CreateModel( - name='LeaveSegment', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('document', models.FileField(null=True, upload_to='leave/leave_documents/')), - ('start_date', models.DateField()), - ('start_half', models.BooleanField(default=False)), - ('end_date', models.DateField()), - ('end_half', models.BooleanField(default=False)), - ('address', models.CharField(blank=True, default='', max_length=500, null=True)), - ('leave', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='segments', to='leave.leave')), - ('leave_type', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='leave.leavetype')), - ], - ), - migrations.CreateModel( - name='LeavesCount', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('year', models.IntegerField(default=2019)), - ('remaining_leaves', models.FloatField(default=2.0)), - ('leave_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='leave.leavetype')), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='leave_balance', to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='LeaveRequest', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('remark', models.CharField(blank=True, max_length=50, null=True)), - ('permission', models.CharField(choices=[('intermediary', 'Intermediary Staff'), ('sanc_auth', 'Leave Sanctioning Authority'), ('sanc_off', 'Leave Sanctioning Officer')], default='sanc_auth', max_length=20)), - ('status', models.CharField(choices=[('pending', 'Pending'), ('accepted', 'Accepted'), ('rejected', 'Rejected'), ('forwarded', 'Forwarded'), ('auto rejected', 'Auto Rejected')], default='pending', max_length=20)), - ('leave', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='leave_requests', to='leave.leave')), - ('requested_from', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='all_leave_requests', to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='LeaveMigration', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('type_migration', models.CharField(choices=[('revert', 'Revert Responsibilities'), ('transfer', 'Transfer Responsibilities')], default='transfer', max_length=10)), - ('on_date', models.DateField()), - ('replacement_type', models.CharField(choices=[('academic', 'Academic Replacement'), ('administrative', 'Administrative Replacement')], default='academic', max_length=20)), - ('leave', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='all_migrations', to='leave.leave')), - ('replacee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='replacee_migrations', to=settings.AUTH_USER_MODEL)), - ('replacer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='replacer_migrations', to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='LeaveAdministrators', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('authority', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sanc_authority_of', to='globals.designation')), - ('officer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sanc_officer_of', to='globals.designation')), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='leave_admins', to=settings.AUTH_USER_MODEL)), - ], - ), - ] diff --git a/FusionIIIT/applications/leave/migrations/__init__.py b/FusionIIIT/applications/leave/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/library/.DS_Store b/FusionIIIT/applications/library/.DS_Store new file mode 100644 index 000000000..44b2c8e56 Binary files /dev/null and b/FusionIIIT/applications/library/.DS_Store differ diff --git a/FusionIIIT/applications/notifications_extension/.DS_Store b/FusionIIIT/applications/notifications_extension/.DS_Store new file mode 100644 index 000000000..e706a3210 Binary files /dev/null and b/FusionIIIT/applications/notifications_extension/.DS_Store differ diff --git a/FusionIIIT/applications/notifications_extension/api/serializers.py b/FusionIIIT/applications/notifications_extension/api/serializers.py new file mode 100644 index 000000000..899c50e57 --- /dev/null +++ b/FusionIIIT/applications/notifications_extension/api/serializers.py @@ -0,0 +1,6 @@ +from rest_framework import serializers +from notifications.models import Notification +class NotificationSerializer(serializers.ModelSerializer): + class Meta: + model = Notification + fields = '__all__' \ No newline at end of file diff --git a/FusionIIIT/applications/notifications_extension/api/urls.py b/FusionIIIT/applications/notifications_extension/api/urls.py new file mode 100644 index 000000000..62238c007 --- /dev/null +++ b/FusionIIIT/applications/notifications_extension/api/urls.py @@ -0,0 +1,53 @@ +# urls.py +from django.urls import path +from .views import ( + LeaveModuleNotificationAPIView, + PlacementCellNotificationAPIView, + AcademicsModuleNotificationAPIView, + OfficeModuleNotificationAPIView, + CentralMessNotificationAPIView, + VisitorsHostelNotificationAPIView, + HealthcareCenterNotificationAPIView, + FileTrackingNotificationAPIView, + ScholarshipPortalNotificationAPIView, + ComplaintSystemNotificationAPIView, + OfficeDeanPnDNotificationAPIView, + OfficeDeanSNotificationAPIView, + GymkhanaVotingNotificationAPIView, + GymkhanaSessionNotificationAPIView, + GymkhanaEventNotificationAPIView, + AssistantshipClaimNotificationAPIView, + DepartmentNotificationAPIView, + OfficeDeanRSPCNotificationAPIView, + ResearchProceduresNotificationAPIView, + HostelModuleNotificationAPIView, + MarkAsRead, + Delete, + NotificationsList, +) + +urlpatterns = [ + path('notifications/', NotificationsList.as_view(), name='notifications' ), + path('delete/', Delete.as_view(),name='delete'), + path('mark_as_read/', MarkAsRead.as_view(),name='mark_as_read'), + path('leave_module_notification/', LeaveModuleNotificationAPIView.as_view(), name='leave_module_notification'), + path('placement_cell_notification/', PlacementCellNotificationAPIView.as_view(), name='placement_cell_notification'), + path('academics_module_notification/', AcademicsModuleNotificationAPIView.as_view(), name='academics_module_notification'), + path('office_module_notification/', OfficeModuleNotificationAPIView.as_view(), name='office_module_notification'), + path('central_mess_notification/', CentralMessNotificationAPIView.as_view(), name='central_mess_notification'), + path('visitors_hostel_notification/', VisitorsHostelNotificationAPIView.as_view(), name='visitors_hostel_notification'), + path('healthcare_center_notification/', HealthcareCenterNotificationAPIView.as_view(), name='healthcare_center_notification'), + path('file_tracking_notification/', FileTrackingNotificationAPIView.as_view(), name='file_tracking_notification'), + path('scholarship_portal_notification/', ScholarshipPortalNotificationAPIView.as_view(), name='scholarship_portal_notification'), + path('complaint_system_notification/', ComplaintSystemNotificationAPIView.as_view(), name='complaint_system_notification'), + path('office_dean_PnD_notification/', OfficeDeanPnDNotificationAPIView.as_view(), name='office_dean_PnD_notification'), + path('office_dean_S_notification/', OfficeDeanSNotificationAPIView.as_view(), name='office_dean_S_notification'), + path('gymkhana_voting/', GymkhanaVotingNotificationAPIView.as_view(), name='gymkhana_voting'), + path('gymkhana_session/', GymkhanaSessionNotificationAPIView.as_view(), name='gymkhana_session'), + path('gymkhana_event/', GymkhanaEventNotificationAPIView.as_view(), name='gymkhana_event'), + path('assistantship_claim/', AssistantshipClaimNotificationAPIView.as_view(), name='assistantship_claim'), + path('department_notification/', DepartmentNotificationAPIView.as_view(), name='department_notification'), + path('office_dean_RSPC_notification/', OfficeDeanRSPCNotificationAPIView.as_view(), name='office_dean_RSPC_notification'), + path('research_procedures_notification/', ResearchProceduresNotificationAPIView.as_view(), name='research_procedures_notification'), + path('hostel_notifications/', HostelModuleNotificationAPIView.as_view(), name='hostel_notifications'), +] diff --git a/FusionIIIT/applications/notifications_extension/api/views.py b/FusionIIIT/applications/notifications_extension/api/views.py new file mode 100644 index 000000000..b9147cd07 --- /dev/null +++ b/FusionIIIT/applications/notifications_extension/api/views.py @@ -0,0 +1,371 @@ +# views.py +from rest_framework.views import APIView +from django.contrib.auth import get_user_model +from rest_framework.response import Response +from notifications.utils import slug2id +from django.shortcuts import get_object_or_404 +from rest_framework.generics import ListAPIView +from notifications.models import Notification +from rest_framework import status +from .serializers import NotificationSerializer +from notification.views import (leave_module_notif, + placement_cell_notif, + academics_module_notif, + office_module_notif, + central_mess_notif, + visitors_hostel_notif, + healthcare_center_notif, + file_tracking_notif, + scholarship_portal_notif, + complaint_system_notif, + office_dean_PnD_notif, + office_module_DeanS_notif, + gymkhana_voting, + gymkhana_session, + gymkhana_event, + AssistantshipClaim_notify, + AssistantshipClaim_faculty_notify, + AssistantshipClaim_acad_notify, + AssistantshipClaim_account_notify, + department_notif, + office_module_DeanRSPC_notif, + research_procedures_notif, + hostel_notifications) + +# import user + +class LeaveModuleNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + type = request.data.get('type') + date = request.data.get('date') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + leave_module_notif(sender, recipient, type, date) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class PlacementCellNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + type = request.data.get('type') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + placement_cell_notif(sender, recipient, type) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class AcademicsModuleNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + type = request.data.get('type') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + academics_module_notif(sender, recipient, type) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class OfficeModuleNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + office_module_notif(sender, recipient) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) +class CentralMessNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + type = request.data.get('type') + message = request.data.get('message') + + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + + # Trigger the notification function + central_mess_notif(sender, recipient, type, message) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class VisitorsHostelNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + type = request.data.get('type') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + visitors_hostel_notif(sender, recipient, type) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class HealthcareCenterNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + type = request.data.get('type') + + # Trigger the notification function + healthcare_center_notif(sender, recipient, type) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class FileTrackingNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + title = request.data.get('title') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + file_tracking_notif(sender, recipient, title) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) +class ScholarshipPortalNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + type = request.data.get('type') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + scholarship_portal_notif(sender, recipient, type) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class ComplaintSystemNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + type = request.data.get('type') + complaint_id = request.data.get('complaint_id') + student = request.data.get('student') + message = request.data.get('message') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + complaint_system_notif(sender, recipient, type, complaint_id, student, message) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class OfficeDeanPnDNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + type = request.data.get('type') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + office_dean_PnD_notif(sender, recipient, type) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class OfficeDeanSNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + type = request.data.get('type') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + office_module_DeanS_notif(sender, recipient, type) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class GymkhanaVotingNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + type = request.data.get('type') + title = request.data.get('title') + desc = request.data.get('desc') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + gymkhana_voting(sender, recipient, type, title, desc) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class GymkhanaSessionNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + type = request.data.get('type') + club = request.data.get('club') + desc = request.data.get('desc') + venue = request.data.get('venue') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + gymkhana_session(sender, recipient, type, club, desc, venue) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class GymkhanaEventNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + type = request.data.get('type') + club = request.data.get('club') + event_name = request.data.get('event_name') + desc = request.data.get('desc') + venue = request.data.get('venue') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + gymkhana_event(sender, recipient, type, club, event_name, desc, venue) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class AssistantshipClaimNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + month = request.data.get('month') + year = request.data.get('year') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + AssistantshipClaim_notify(sender, recipient, month, year) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) +class AssistantshipClaimFacultyNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + AssistantshipClaim_faculty_notify(sender, recipient) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class AssistantshipClaimAcadNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + AssistantshipClaim_acad_notify(sender, recipient) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class AssistantshipClaimAccountNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + stu = request.data.get('stu') + recipient_id = request.data.get('recipient') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + AssistantshipClaim_account_notify(sender, stu, recipient) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class DepartmentNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + type = request.data.get('type') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + department_notif(sender, recipient, type) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) +class OfficeDeanRSPCNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + type = request.data.get('type') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + office_module_DeanRSPC_notif(sender, recipient, type) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class ResearchProceduresNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + type = request.data.get('type') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + research_procedures_notif(sender, recipient, type) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class HostelModuleNotificationAPIView(APIView): + def post(self, request, *args, **kwargs): + # Extract data from the request, you can customize this based on your needs + sender = request.user + recipient_id = request.data.get('recipient') + type = request.data.get('type') + User = get_user_model() + recipient = User.objects.get(pk=recipient_id) + # Trigger the notification function + hostel_notifications(sender, recipient, type) + + return Response({'message': 'Notification sent successfully'}, status=status.HTTP_201_CREATED) + +class MarkAsRead(APIView): + + def put(self,request,**args): + notification_id = self.request.query_params.get('id') + notification = get_object_or_404( + Notification, recipient=request.user, id=notification_id) + + notification.mark_as_read() + + return Response({'message': "Successfully marked as read"}, status=status.HTTP_200_OK) + +class Delete(APIView): + + def delete(self,request, **args): + notification_id = self.request.query_params.get('id') + notification = get_object_or_404( + Notification, recipient=request.user, id=notification_id) + + notification.delete() + + return Response({'message': "Notification deleted succesfully"}, status=status.HTTP_200_OK) + +class NotificationsList(ListAPIView): + # queryset = Notification.objects.all(actor_object_id=) + serializer_class = NotificationSerializer + def get_queryset(self): + return Notification.objects.all().filter(recipient_id=self.request.user.id) \ No newline at end of file diff --git a/FusionIIIT/applications/notifications_extension/migrations/__init__.py b/FusionIIIT/applications/notifications_extension/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/notifications_extension/urls.py b/FusionIIIT/applications/notifications_extension/urls.py index c5b2da49d..b5690994b 100644 --- a/FusionIIIT/applications/notifications_extension/urls.py +++ b/FusionIIIT/applications/notifications_extension/urls.py @@ -4,8 +4,12 @@ from django.conf.urls import include, url from . import views +# from .api import urls + app_name = 'notifications' urlpatterns = [ pattern(r'^mark-as-read-and-redirect/(?P\d+)/$', views.mark_as_read_and_redirect, name='mark_as_read_and_redirect'), + pattern(r'^delete/(?P\d+)/$', views.delete, name='delete'), + url(r'^api/',include('applications.notifications_extension.api.urls')), ] + urlpatterns diff --git a/FusionIIIT/applications/notifications_extension/views.py b/FusionIIIT/applications/notifications_extension/views.py index fc482ef77..57142f0a6 100644 --- a/FusionIIIT/applications/notifications_extension/views.py +++ b/FusionIIIT/applications/notifications_extension/views.py @@ -3,9 +3,14 @@ from notifications.utils import id2slug, slug2id from django.shortcuts import get_object_or_404, redirect from notifications.models import Notification - - - +import Fusion.settings as FusionIIIT_settings +def delete(request, slug=None): + notification_id = slug2id(slug) + notification = get_object_or_404( + Notification, recipient=request.user, id=notification_id) + notification.delete() + return HttpResponseRedirect('/') + # return HttpResponseRedirect('dashboard/') def mark_as_read_and_redirect(request, slug=None): notification_id = slug2id(slug) notification = get_object_or_404( @@ -14,8 +19,9 @@ def mark_as_read_and_redirect(request, slug=None): # This conditional statement is True only in # case of complaint_module. + # return redirect('notifications:all') - if(notification.data['module'] == 'Complaint System'): + if(notification.data['module'] == 'Complaint System'): complaint_id=notification.description return HttpResponseRedirect(reverse(notification.data['url'],kwargs={'detailcomp_id1':complaint_id})) else: diff --git a/FusionIIIT/applications/office_module/.DS_Store b/FusionIIIT/applications/office_module/.DS_Store new file mode 100644 index 000000000..f87c4b174 Binary files /dev/null and b/FusionIIIT/applications/office_module/.DS_Store differ diff --git a/FusionIIIT/applications/office_module/migrations/0001_initial.py b/FusionIIIT/applications/office_module/migrations/0001_initial.py deleted file mode 100644 index 521c8e886..000000000 --- a/FusionIIIT/applications/office_module/migrations/0001_initial.py +++ /dev/null @@ -1,492 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -import datetime -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('academic_information', '0001_initial'), - ('filetracking', '0001_initial'), - ('leave', '0001_initial'), - ('globals', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Budget', - fields=[ - ('id', models.AutoField(primary_key=True, serialize=False)), - ('budget_type', models.CharField(max_length=20)), - ('club_type', models.CharField(choices=[('TECHNICAL', 'technical'), ('CULTURAL', 'cultural'), ('SPORTS', 'sports')], default='', max_length=20)), - ('budget_allocated', models.PositiveIntegerField(default=0)), - ('budget_expenditure', models.PositiveIntegerField(default=0)), - ('budget_available', models.PositiveIntegerField(default=0)), - ], - ), - migrations.CreateModel( - name='hostel_allotment', - fields=[ - ('id', models.AutoField(primary_key=True, serialize=False)), - ('program', models.CharField(choices=[('BTECH', 'btech'), ('BDES', 'bdes'), ('MTECH', 'mtech'), ('MDES', 'mdes'), ('PHD', 'phd')], default='', max_length=30)), - ('year', models.IntegerField(default=2016)), - ('gender', models.CharField(choices=[('MALE', 'male'), ('FEMALE', 'female')], default='', max_length=10)), - ('hall_no', models.CharField(choices=[('HALL-1-BOYS', 'hall-1-boys'), ('HALL-1-GIRLS', 'hall-1-girls'), ('HALL-3', 'hall-3'), ('HALL-4', 'hall-4')], default='', max_length=15)), - ('number_students', models.PositiveIntegerField(default=0)), - ('remark', models.CharField(max_length=200)), - ], - options={ - 'db_table': 'hostel_allotment', - }, - ), - migrations.CreateModel( - name='hostel_capacity', - fields=[ - ('id', models.AutoField(primary_key=True, serialize=False)), - ('name', models.CharField(choices=[('HALL-1-BOYS', 'hall-1-boys'), ('HALL-1-GIRLS', 'hall-1-girls'), ('HALL-3', 'hall-3'), ('HALL-4', 'hall-4')], default='', max_length=15)), - ('current_capacity', models.PositiveIntegerField(default=0)), - ('total_capacity', models.PositiveIntegerField(default=0)), - ], - options={ - 'db_table': 'hostel_capacity', - }, - ), - migrations.CreateModel( - name='Lab', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('lab', models.CharField(max_length=10)), - ('lab_instructor', models.CharField(max_length=30)), - ('day', models.CharField(choices=[('Monday', 'Monday'), ('Tuesday', 'Tuesday'), ('Wednesday', 'Wednesday'), ('Thursday', 'Thursday'), ('Friday', 'Friday')], default='Monday', max_length=10)), - ('s_time', models.CharField(default='0:00', max_length=6)), - ('e_time', models.CharField(default='0:00', max_length=6)), - ], - options={ - 'db_table': 'Lab', - }, - ), - migrations.CreateModel( - name='quotations', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('quotation1', models.FileField(upload_to='')), - ('quotation2', models.FileField(upload_to='')), - ('quotation3', models.FileField(upload_to='')), - ], - options={ - 'db_table': 'quotations', - }, - ), - migrations.CreateModel( - name='Registrar', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('file_name', models.CharField(max_length=50)), - ('date', models.DateField()), - ('purpose', models.CharField(max_length=100)), - ('status', models.CharField(choices=[('0', 'unseen'), ('1', 'seen')], default=0, max_length=1)), - ('file', models.FileField(upload_to='')), - ], - ), - migrations.CreateModel( - name='registrar_create_doc', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('file_name', models.CharField(max_length=50)), - ('purpose', models.CharField(max_length=100)), - ('Description', models.CharField(max_length=200)), - ('file', models.FileField(upload_to='')), - ], - ), - migrations.CreateModel( - name='registrar_director_section', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('file_name', models.CharField(max_length=50)), - ('date', models.DateField()), - ('purpose', models.CharField(max_length=100)), - ('status', models.CharField(choices=[('0', 'unseen'), ('1', 'seen')], default=0, max_length=1)), - ], - ), - migrations.CreateModel( - name='registrar_establishment_section', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('person_name', models.CharField(max_length=50)), - ('person_mail_id', models.CharField(default='xyz', max_length=50)), - ('date', models.DateField()), - ('duration', models.IntegerField()), - ('post', models.CharField(max_length=100)), - ('file', models.FileField(upload_to='')), - ], - ), - migrations.CreateModel( - name='registrar_finance_section', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('file_name', models.CharField(max_length=50)), - ('date', models.DateField()), - ('purpose', models.CharField(max_length=100)), - ('status', models.IntegerField(choices=[('0', 'unseen'), ('1', 'seen')])), - ('file', models.FileField(upload_to='')), - ], - ), - migrations.CreateModel( - name='registrar_purchase_sales_section', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('file_name', models.CharField(max_length=50)), - ('member1', models.CharField(max_length=50)), - ('member2', models.CharField(max_length=50)), - ('member3', models.CharField(max_length=50)), - ('date', models.DateField()), - ('purpose', models.CharField(max_length=100)), - ('status', models.IntegerField(choices=[('0', 'unseen'), ('1', 'seen')], default=0)), - ('file', models.FileField(upload_to='')), - ], - ), - migrations.CreateModel( - name='stock', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('item_name', models.CharField(max_length=100)), - ('quantity', models.IntegerField(default='0')), - ('item_type', models.IntegerField(choices=[('0', 'Non-consumable'), ('1', 'Consumable')], default='0')), - ], - options={ - 'db_table': 'stock', - }, - ), - migrations.CreateModel( - name='Teaching_credits1', - fields=[ - ('roll_no', models.CharField(max_length=100, primary_key=True, serialize=False)), - ('name', models.CharField(max_length=100)), - ('programme', models.CharField(max_length=100)), - ('branch', models.CharField(max_length=100)), - ('course1', models.CharField(choices=[('Computer Graphics', 'Computer Graphics'), ('Machine Learning', 'Machine Learning'), ('Image Processing', 'Image Processing'), ('Data Structure', 'Data Structure')], default='NO', max_length=100)), - ('course2', models.CharField(choices=[('Computer Graphics', 'Computer Graphics'), ('Machine Learning', 'Machine Learning'), ('Image Processing', 'Image Processing'), ('Data Structure', 'Data Structure')], default='NO', max_length=100)), - ('course3', models.CharField(choices=[('Computer Graphics', 'Computer Graphics'), ('Machine Learning', 'Machine Learning'), ('Image Processing', 'Image Processing'), ('Data Structure', 'Data Structure')], default='NO', max_length=100)), - ('tag', models.IntegerField(default=0)), - ], - options={ - 'db_table': 'Teaching_credits1', - }, - ), - migrations.CreateModel( - name='vendor', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('vendor_name', models.CharField(max_length=100)), - ('vendor_address', models.CharField(max_length=200)), - ('vendor_item', models.CharField(max_length=200)), - ], - options={ - 'db_table': 'vendor', - }, - ), - migrations.CreateModel( - name='TA_assign', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('balance', models.IntegerField(default=2)), - ('lab', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='office_module.lab')), - ('roll_no', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='TA_id', to='globals.extrainfo')), - ], - options={ - 'db_table': 'TA_assign', - }, - ), - migrations.CreateModel( - name='Requisitions', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('req_date', models.DateTimeField(auto_now_add=True)), - ('title', models.CharField(max_length=50)), - ('department', models.CharField(choices=[('civil', 'civil'), ('electrical', 'electrical')], max_length=50)), - ('building', models.CharField(choices=[('corelab', 'corelab'), ('computer center', 'computer center'), ('hostel', 'hostel'), ('mess', 'mess'), ('library', 'library'), ('cc', 'cc')], max_length=50)), - ('description', models.CharField(max_length=200)), - ('tag', models.IntegerField(default=0)), - ('assign_file', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='filetracking.file')), - ('userid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='Registrar_response', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('remark', models.CharField(default='', max_length=50)), - ('status', models.CharField(default='', max_length=20)), - ('track_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='t_id', to='filetracking.tracking')), - ], - options={ - 'db_table': 'Registrar_response', - }, - ), - migrations.CreateModel( - name='registrar_general_section', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('file_name', models.CharField(max_length=50)), - ('date', models.DateField()), - ('amount', models.IntegerField()), - ('status', models.IntegerField(choices=[('0', 'unseen'), ('1', 'seen')], default=0)), - ('file', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='office_module.registrar_create_doc')), - ], - ), - migrations.CreateModel( - name='Registrar_File', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('status', models.IntegerField(choices=[('0', 'unseen'), ('1', 'seen')], default=0)), - ('approval', models.IntegerField(choices=[('0', 'reject'), ('1', 'accept')], default=0)), - ('section_name', models.CharField(max_length=50)), - ('section_type', models.CharField(max_length=20)), - ('file_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='filetracking.tracking')), - ], - ), - migrations.CreateModel( - name='purchase_commitee', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('approve_mem1', models.IntegerField(choices=[('0', 'Pending'), ('1', 'Approve'), ('-1', 'Rejected')], default='0')), - ('approve_mem2', models.IntegerField(choices=[('0', 'Pending'), ('1', 'Approve'), ('-1', 'Rejected')], default='0')), - ('approve_mem3', models.IntegerField(choices=[('0', 'Pending'), ('1', 'Approve'), ('-1', 'Rejected')], default='0')), - ('local_comm_mem1', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='local_comm_mem1', to='globals.extrainfo')), - ('local_comm_mem2', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='local_comm_mem2', to='globals.extrainfo')), - ('local_comm_mem3', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='local_comm_mem3', to='globals.extrainfo')), - ], - options={ - 'db_table': 'purchase_commitee', - }, - ), - migrations.CreateModel( - name='Project_Registration', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('project_title', models.CharField(max_length=200)), - ('sponsored_agency', models.CharField(max_length=100)), - ('CO_PI', models.CharField(max_length=100, null=True)), - ('start_date', models.DateField(blank=True, null=True)), - ('duration', models.IntegerField(default=0)), - ('agreement', models.CharField(choices=[('Computer Graphics', 'Computer Graphics'), ('Machine Learning', 'Machine Learning'), ('Image Processing', 'Image Processing'), ('Data Structure', 'Data Structure')], default='NO', max_length=20)), - ('amount_sanctioned', models.IntegerField(default=0)), - ('project_type', models.CharField(choices=[('SRes', 'Sponsored Research'), ('Consultancy', 'Consultancy'), ('fig', 'Faculty Initiation Grant'), ('Testing', 'Testing')], max_length=25)), - ('project_operated', models.CharField(choices=[('PI', 'Only by PI'), ('any', 'Either PI or CO-PI')], default='me', max_length=50)), - ('remarks', models.CharField(max_length=200)), - ('fund_recieved_date', models.DateField(blank=True, null=True)), - ('HOD_response', models.CharField(choices=[('Forwarded', 'Forwarded'), ('Pending', 'Pending')], default='Pending', max_length=10)), - ('DRSPC_response', models.CharField(choices=[('Approve', 'Approve'), ('Disapprove', 'Disapprove'), ('Pending', 'Pending')], default='Pending', max_length=10)), - ('applied_date', models.DateField(blank=True, null=True)), - ('description', models.CharField(max_length=200, null=True)), - ('file', models.FileField(blank=True, null=True, upload_to='documents/')), - ('PI_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='Project_Reallocation', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date', models.DateField(blank=True, null=True)), - ('previous_budget_head', models.CharField(max_length=300)), - ('previous_amount', models.IntegerField(default=0)), - ('pf_no', models.CharField(max_length=100, null=True)), - ('new_budget_head', models.CharField(max_length=300)), - ('new_amount', models.IntegerField(default=0)), - ('transfer_reason', models.CharField(max_length=300)), - ('HOD_response', models.CharField(choices=[('Forwarded', 'Forwarded'), ('Pending', 'Pending')], default='Pending', max_length=10)), - ('DRSPC_response', models.CharField(choices=[('Approve', 'Approve'), ('Disapprove', 'Disapprove'), ('Pending', 'Pending')], default='Pending', max_length=10)), - ('project_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='office_module.project_registration')), - ], - ), - migrations.CreateModel( - name='Project_Extension', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date', models.DateField(blank=True, null=True)), - ('extended_duration', models.IntegerField(default=0)), - ('extension_details', models.CharField(max_length=300)), - ('HOD_response', models.CharField(choices=[('Forwarded', 'Forwarded'), ('Pending', 'Pending')], default='Pending', max_length=10)), - ('DRSPC_response', models.CharField(choices=[('Approve', 'Approve'), ('Disapprove', 'Disapprove'), ('Pending', 'Pending')], default='Pending', max_length=10)), - ('file', models.FileField(blank=True, null=True, upload_to='documents/')), - ('project_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='office_module.project_registration')), - ], - ), - migrations.CreateModel( - name='Project_Closure', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('completion_date', models.DateField(blank=True, null=True)), - ('date', models.DateField(blank=True, null=True)), - ('expenses_dues', models.CharField(choices=[('Computer Graphics', 'Computer Graphics'), ('Machine Learning', 'Machine Learning'), ('Image Processing', 'Image Processing'), ('Data Structure', 'Data Structure')], default='Pending', max_length=20)), - ('expenses_dues_description', models.CharField(blank=True, max_length=200, null=True)), - ('payment_dues', models.CharField(choices=[('Computer Graphics', 'Computer Graphics'), ('Machine Learning', 'Machine Learning'), ('Image Processing', 'Image Processing'), ('Data Structure', 'Data Structure')], default='Pending', max_length=20)), - ('payment_dues_description', models.CharField(blank=True, max_length=200, null=True)), - ('salary_dues', models.CharField(choices=[('Computer Graphics', 'Computer Graphics'), ('Machine Learning', 'Machine Learning'), ('Image Processing', 'Image Processing'), ('Data Structure', 'Data Structure')], default='Pending', max_length=20)), - ('salary_dues_description', models.CharField(blank=True, max_length=200, null=True)), - ('advances_dues', models.CharField(choices=[('Computer Graphics', 'Computer Graphics'), ('Machine Learning', 'Machine Learning'), ('Image Processing', 'Image Processing'), ('Data Structure', 'Data Structure')], default='Pending', max_length=20)), - ('advances_description', models.CharField(blank=True, max_length=200, null=True)), - ('others_dues', models.CharField(choices=[('Computer Graphics', 'Computer Graphics'), ('Machine Learning', 'Machine Learning'), ('Image Processing', 'Image Processing'), ('Data Structure', 'Data Structure')], default='Pending', max_length=20)), - ('other_dues_description', models.CharField(blank=True, max_length=200, null=True)), - ('overhead_deducted', models.CharField(choices=[('Computer Graphics', 'Computer Graphics'), ('Machine Learning', 'Machine Learning'), ('Image Processing', 'Image Processing'), ('Data Structure', 'Data Structure')], default='Pending', max_length=20)), - ('overhead_description', models.CharField(blank=True, max_length=200, null=True)), - ('HOD_response', models.CharField(choices=[('Forwarded', 'Forwarded'), ('Pending', 'Pending')], default='Pending', max_length=10)), - ('DRSPC_response', models.CharField(choices=[('Approve', 'Approve'), ('Disapprove', 'Disapprove'), ('Pending', 'Pending')], default='Pending', max_length=10)), - ('remarks', models.CharField(max_length=300, null=True)), - ('extended_duration', models.CharField(default='0', max_length=100, null=True)), - ('project_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='office_module.project_registration')), - ], - ), - migrations.CreateModel( - name='LTC', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date_request', models.DateField()), - ('travel_mode', models.CharField(choices=[('road', 'ROAD'), ('rail', 'RAIL')], default='ROAD', max_length=10)), - ('advance', models.IntegerField(default=0)), - ('family_details', models.TextField(max_length=500)), - ('department', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.departmentinfo')), - ('designation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.designation')), - ('leave', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='leave.leave')), - ('name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - options={ - 'db_table': 'LTC', - }, - ), - migrations.CreateModel( - name='hostel_guestroom_approval', - fields=[ - ('id', models.AutoField(primary_key=True, serialize=False)), - ('hall_no', models.CharField(choices=[('HALL-1-BOYS', 'hall-1-boys'), ('HALL-1-GIRLS', 'hall-1-girls'), ('HALL-3', 'hall-3'), ('HALL-4', 'hall-4')], default='', max_length=16)), - ('arrival_date', models.DateField(default=datetime.date.today, verbose_name='Date')), - ('departure_date', models.DateField(blank=True, null=True)), - ('status', models.CharField(choices=[('APPROVED', 'Approved'), ('PENDING', 'Pending')], default='Pending', max_length=20)), - ('intender', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='Filemovement', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date', models.DateTimeField(auto_now_add=True)), - ('remarks', models.CharField(max_length=200, null=True)), - ('actionby_receiver', models.CharField(choices=[('forward', 'forwarded'), ('revert', 'revert'), ('accept', 'accept'), ('reject', 'reject')], max_length=50)), - ('receivedby', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='received_by', to='globals.holdsdesignation')), - ('rid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='office_module.requisitions')), - ('sentby', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sent_by', to='globals.holdsdesignation')), - ], - ), - migrations.CreateModel( - name='DeanS_approve_committes', - fields=[ - ('id', models.AutoField(primary_key=True, serialize=False)), - ('date_approved', models.DateField(blank=True, null=True)), - ('description', models.CharField(max_length=200)), - ('convener', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='convener', to='globals.extrainfo')), - ('faculty_incharge', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='facultyincharge', to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='CPDA', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('PF_no', models.CharField(max_length=100)), - ('purpose', models.CharField(max_length=100)), - ('amoutn', models.IntegerField(default=0)), - ('designation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.designation')), - ('name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - options={ - 'db_table': 'CPDA', - }, - ), - migrations.CreateModel( - name='Auto_fair_claim', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('purpose', models.CharField(max_length=100)), - ('amount', models.IntegerField(default=0)), - ('auto_reg_no', models.CharField(max_length=50)), - ('auto_contact', models.IntegerField(default=0)), - ('bill', models.FileField(upload_to='hod/')), - ('date', models.DateField()), - ('name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - options={ - 'db_table': 'auto_fair_claim', - }, - ), - migrations.CreateModel( - name='Assigned_Teaching_credits', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('assigned_course', models.CharField(default='NO', max_length=100)), - ('roll_no', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='office_module.teaching_credits1')), - ], - options={ - 'db_table': 'Assigned_Teaching_credits', - }, - ), - migrations.CreateModel( - name='apply_for_purchase', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('inspecting_authority', models.CharField(default='0', max_length=200)), - ('expected_purchase_date', models.DateField()), - ('order_date', models.DateField(default=datetime.date.today)), - ('purchase_status', models.IntegerField(choices=[('0', 'Pending'), ('1', 'Approve'), ('2', 'Items Ordered'), ('3', 'Items Puchased'), ('4', 'Items Delivered')], default=0)), - ('amount', models.IntegerField(default='0')), - ('purchase_date', models.DateField(default='2018-06-01')), - ('registrar_approve_tag', models.IntegerField(choices=[('0', 'Pending'), ('1', 'Approve'), ('-1', 'Rejected')], default=0)), - ('director_approve_tag', models.IntegerField(choices=[('0', 'Pending'), ('1', 'Approve'), ('-1', 'Rejected')], default=0)), - ('HOD_approve_tag', models.IntegerField(choices=[('0', 'Pending'), ('1', 'Approve'), ('-1', 'Rejected')], default=0)), - ('accounts_approve_tag', models.IntegerField(choices=[('0', 'Pending'), ('1', 'Approve'), ('-1', 'Rejected')], default=0)), - ('gem_tag', models.IntegerField(choices=[('0', 'Pending'), ('1', 'Approve'), ('-1', 'Rejected')], default=0)), - ('purchase_type', models.IntegerField(choices=[('0', 'Amount < 25000'), ('1', '250002500000')], default=0)), - ('purpose', models.CharField(default=0, max_length=200)), - ('budgetary_head', models.CharField(default=0, max_length=200)), - ('invoice', models.FileField(default=0, upload_to='')), - ('nature_of_item1', models.IntegerField(choices=[('0', 'Non-consumable'), ('1', 'Consumable')], default=0)), - ('nature_of_item2', models.IntegerField(choices=[('0', 'Equipment'), ('1', 'Machinery'), ('2', 'Furniture'), ('3', 'Fixture')], default=0)), - ('item_name', models.CharField(default=0, max_length=100)), - ('expected_cost', models.IntegerField(default=0)), - ('quantity', models.IntegerField(default=0)), - ('indentor_name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='indentor_name', to='globals.extrainfo')), - ], - options={ - 'db_table': 'apply_for_purchase', - }, - ), - migrations.CreateModel( - name='Member', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('meeting_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.meeting')), - ('member_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.faculty')), - ], - options={ - 'db_table': 'Member', - 'unique_together': {('member_id', 'meeting_id')}, - }, - ), - migrations.CreateModel( - name='Assistantship', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('file', models.FileField(blank=True, null=True, upload_to='documents/')), - ('action', models.IntegerField(default=0)), - ('comments', models.CharField(blank=True, max_length=150, null=True)), - ('instructor_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.curriculum_instructor')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'Assistantship', - 'unique_together': {('student_id', 'instructor_id')}, - }, - ), - ] diff --git a/FusionIIIT/applications/office_module/migrations/__init__.py b/FusionIIIT/applications/office_module/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/online_cms/.DS_Store b/FusionIIIT/applications/online_cms/.DS_Store new file mode 100644 index 000000000..3787b026a Binary files /dev/null and b/FusionIIIT/applications/online_cms/.DS_Store differ diff --git a/FusionIIIT/applications/online_cms/migrations/0001_initial.py b/FusionIIIT/applications/online_cms/migrations/0001_initial.py deleted file mode 100644 index 4e3377ab7..000000000 --- a/FusionIIIT/applications/online_cms/migrations/0001_initial.py +++ /dev/null @@ -1,196 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('academic_information', '0001_initial'), - ('globals', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Assignment', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('upload_time', models.DateTimeField(auto_now=True)), - ('submit_date', models.DateTimeField()), - ('assignment_name', models.CharField(max_length=100)), - ('assignment_url', models.CharField(max_length=100, null=True)), - ('course_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.course')), - ], - ), - migrations.CreateModel( - name='Forum', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('comment_time', models.DateTimeField(auto_now=True)), - ('comment', models.TextField(max_length=2000)), - ('commenter_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ('course_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.course')), - ], - ), - migrations.CreateModel( - name='Practice', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('prac_quiz_name', models.CharField(max_length=20)), - ('negative_marks', models.FloatField(default=0)), - ('number_of_question', models.IntegerField(default=0)), - ('description', models.TextField(max_length=1000)), - ('total_score', models.IntegerField(default=0)), - ('course_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.course')), - ], - ), - migrations.CreateModel( - name='Question', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('question', models.TextField(max_length=1000)), - ('options1', models.CharField(max_length=100, null=True)), - ('options2', models.CharField(max_length=100, null=True)), - ('options3', models.CharField(max_length=100, null=True)), - ('options4', models.CharField(max_length=100, null=True)), - ('options5', models.CharField(max_length=100, null=True)), - ('answer', models.IntegerField()), - ('image', models.TextField(max_length=1000, null=True)), - ('marks', models.IntegerField()), - ], - ), - migrations.CreateModel( - name='Quiz', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('quiz_name', models.CharField(max_length=20)), - ('end_time', models.DateTimeField()), - ('start_time', models.DateTimeField()), - ('d_day', models.CharField(max_length=2)), - ('d_hour', models.CharField(max_length=2)), - ('d_minute', models.CharField(max_length=2)), - ('negative_marks', models.FloatField(default=0)), - ('number_of_question', models.IntegerField(default=0)), - ('description', models.TextField(max_length=1000)), - ('rules', models.TextField(max_length=2000)), - ('total_score', models.IntegerField(default=0)), - ('course_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.course')), - ], - ), - migrations.CreateModel( - name='QuizQuestion', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='online_cms.question')), - ('quiz_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='online_cms.quiz')), - ], - ), - migrations.CreateModel( - name='Topics', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('topic_name', models.TextField(max_length=200)), - ('course_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.course')), - ], - ), - migrations.CreateModel( - name='StudentAssignment', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('upload_time', models.DateTimeField(auto_now=True)), - ('upload_url', models.TextField(max_length=200)), - ('score', models.IntegerField(null=True)), - ('feedback', models.CharField(max_length=100, null=True)), - ('assign_name', models.CharField(max_length=100)), - ('assignment_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='online_cms.assignment')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='StudentAnswer', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('choice', models.IntegerField()), - ('question_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='online_cms.quizquestion')), - ('quiz_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='online_cms.quiz')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='QuizResult', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('score', models.IntegerField()), - ('finished', models.BooleanField(default=False)), - ('quiz_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='online_cms.quiz')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='QuestionBank', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=100)), - ('course_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.course')), - ('instructor_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - migrations.AddField( - model_name='question', - name='question_bank', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='online_cms.questionbank'), - ), - migrations.AddField( - model_name='question', - name='topic', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='online_cms.topics'), - ), - migrations.CreateModel( - name='PracticeQuestion', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('question', models.TextField(max_length=1000)), - ('options1', models.CharField(max_length=100, null=True)), - ('options2', models.CharField(max_length=100, null=True)), - ('options3', models.CharField(max_length=100, null=True)), - ('options4', models.CharField(max_length=100, null=True)), - ('options5', models.CharField(max_length=100, null=True)), - ('answer', models.IntegerField()), - ('image', models.TextField(max_length=1000, null=True)), - ('prac_quiz_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='online_cms.practice')), - ], - ), - migrations.CreateModel( - name='ForumReply', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('forum_ques', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='forum_ques', to='online_cms.forum')), - ('forum_reply', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='forum_reply', to='online_cms.forum')), - ], - ), - migrations.CreateModel( - name='CourseVideo', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('upload_time', models.DateTimeField(auto_now=True)), - ('description', models.CharField(max_length=100)), - ('video_name', models.CharField(max_length=40)), - ('video_url', models.CharField(max_length=100, null=True)), - ('course_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.course')), - ], - ), - migrations.CreateModel( - name='CourseDocuments', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('upload_time', models.DateTimeField(auto_now=True)), - ('description', models.CharField(max_length=100)), - ('document_name', models.CharField(max_length=40)), - ('document_url', models.CharField(max_length=100, null=True)), - ('course_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.course')), - ], - ), - ] diff --git a/FusionIIIT/applications/online_cms/migrations/__init__.py b/FusionIIIT/applications/online_cms/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/placement_cell/.DS_Store b/FusionIIIT/applications/placement_cell/.DS_Store new file mode 100644 index 000000000..95a611396 Binary files /dev/null and b/FusionIIIT/applications/placement_cell/.DS_Store differ diff --git a/FusionIIIT/applications/placement_cell/migrations/0001_initial.py b/FusionIIIT/applications/placement_cell/migrations/0001_initial.py deleted file mode 100644 index 257c98609..000000000 --- a/FusionIIIT/applications/placement_cell/migrations/0001_initial.py +++ /dev/null @@ -1,289 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -import datetime -from django.db import migrations, models -import django.db.models.deletion -import django.utils.timezone - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('academic_information', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='ChairmanVisit', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('company_name', models.CharField(default='', max_length=100)), - ('location', models.CharField(default='', max_length=100)), - ('visiting_date', models.DateField(default=datetime.date.today, verbose_name='Date')), - ('description', models.TextField(blank=True, default='', max_length=1000, null=True)), - ('timestamp', models.DateTimeField(auto_now=True)), - ], - ), - migrations.CreateModel( - name='CompanyDetails', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('company_name', models.CharField(blank=True, max_length=100, null=True)), - ], - ), - migrations.CreateModel( - name='MessageOfficer', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('message', models.CharField(default='', max_length=100)), - ('timestamp', models.DateTimeField(auto_now=True)), - ], - ), - migrations.CreateModel( - name='NotifyStudent', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('placement_type', models.CharField(choices=[('PLACEMENT', 'Placement'), ('PBI', 'PBI'), ('HIGHER STUDIES', 'Higher Studies'), ('OTHER', 'Other')], default='PLACEMENT', max_length=20)), - ('company_name', models.CharField(default='', max_length=100)), - ('ctc', models.DecimalField(decimal_places=4, max_digits=10)), - ('description', models.TextField(blank=True, default='', max_length=1000, null=True)), - ('timestamp', models.DateTimeField(auto_now=True)), - ], - ), - migrations.CreateModel( - name='PlacementRecord', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('placement_type', models.CharField(choices=[('PLACEMENT', 'Placement'), ('PBI', 'PBI'), ('HIGHER STUDIES', 'Higher Studies'), ('OTHER', 'Other')], default='PLACEMENT', max_length=20)), - ('name', models.CharField(default='', max_length=100)), - ('ctc', models.DecimalField(decimal_places=2, default=0, max_digits=5)), - ('year', models.IntegerField(default=0)), - ('test_score', models.IntegerField(blank=True, default=0, null=True)), - ('test_type', models.CharField(blank=True, default='', max_length=30, null=True)), - ], - ), - migrations.CreateModel( - name='Role', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('role', models.CharField(blank=True, max_length=100, null=True)), - ], - ), - migrations.CreateModel( - name='Skill', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('skill', models.CharField(default='', max_length=30)), - ], - ), - migrations.CreateModel( - name='StudentPlacement', - fields=[ - ('unique_id', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='academic_information.student')), - ('debar', models.CharField(choices=[('NOT DEBAR', 'Not Debar'), ('DEBAR', 'Debar')], default='NOT DEBAR', max_length=20)), - ('future_aspect', models.CharField(choices=[('PLACEMENT', 'Placement'), ('PBI', 'PBI'), ('HIGHER STUDIES', 'Higher Studies'), ('OTHER', 'Other')], default='PLACEMENT', max_length=20)), - ('placed_type', models.CharField(choices=[('NOT PLACED', 'Not Placed'), ('PLACED', 'Placed')], default='NOT PLACED', max_length=20)), - ('placement_date', models.DateField(blank=True, default=datetime.date.today, null=True, verbose_name='Date')), - ('package', models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True)), - ], - ), - migrations.CreateModel( - name='Reference', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('reference_name', models.CharField(default='', max_length=100)), - ('post', models.CharField(blank=True, default='', max_length=100, null=True)), - ('email', models.CharField(default='', max_length=50)), - ('mobile_number', models.CharField(blank=True, max_length=15, null=True)), - ('unique_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='Publication', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('publication_title', models.CharField(default='', max_length=100)), - ('description', models.TextField(blank=True, default='', max_length=250, null=True)), - ('publisher', models.TextField(default='', max_length=250)), - ('publication_date', models.DateField(default=datetime.date.today, verbose_name='Date')), - ('unique_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='Project', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('project_name', models.CharField(default='', max_length=50)), - ('project_status', models.CharField(choices=[('ONGOING', 'Ongoing'), ('COMPLETED', 'Completed')], default='COMPLETED', max_length=20)), - ('summary', models.TextField(blank=True, default='', max_length=1000, null=True)), - ('project_link', models.CharField(blank=True, default='', max_length=200, null=True)), - ('sdate', models.DateField(default=datetime.date.today, verbose_name='Date')), - ('edate', models.DateField(blank=True, null=True)), - ('unique_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='PlacementSchedule', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('title', models.CharField(default='', max_length=100)), - ('placement_date', models.DateField(default=datetime.date.today, verbose_name='Date')), - ('location', models.CharField(default='', max_length=100)), - ('description', models.TextField(blank=True, default='', max_length=500, null=True)), - ('time', models.TimeField()), - ('attached_file', models.FileField(blank=True, null=True, upload_to='documents/placement/schedule')), - ('schedule_at', models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True)), - ('notify_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='placement_cell.notifystudent')), - ('role', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='placement_cell.role')), - ], - ), - migrations.CreateModel( - name='Patent', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('patent_name', models.CharField(default='', max_length=100)), - ('description', models.TextField(blank=True, default='', max_length=250, null=True)), - ('patent_office', models.TextField(default='', max_length=250)), - ('patent_date', models.DateField()), - ('unique_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='Interest', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('interest', models.CharField(default='', max_length=100)), - ('unique_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='Extracurricular', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('event_name', models.CharField(default='', max_length=100)), - ('event_type', models.CharField(choices=[('SOCIAL', 'Social'), ('CULTURE', 'Culture'), ('SPORT', 'Sport'), ('OTHER', 'Other')], default='OTHER', max_length=20)), - ('description', models.TextField(blank=True, default='', max_length=1000, null=True)), - ('name_of_position', models.CharField(default='', max_length=200)), - ('date_earned', models.DateField(default=datetime.date.today, verbose_name='Date')), - ('unique_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='Experience', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('title', models.CharField(default='', max_length=100)), - ('status', models.CharField(choices=[('ONGOING', 'Ongoing'), ('COMPLETED', 'Completed')], default='COMPLETED', max_length=20)), - ('description', models.TextField(blank=True, default='', max_length=500, null=True)), - ('company', models.CharField(default='', max_length=200)), - ('location', models.CharField(default='', max_length=200)), - ('sdate', models.DateField(default=datetime.date.today, verbose_name='Date')), - ('edate', models.DateField(blank=True, null=True)), - ('unique_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='Education', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('degree', models.CharField(default='', max_length=40)), - ('grade', models.CharField(default='', max_length=10)), - ('institute', models.TextField(default='', max_length=250)), - ('stream', models.CharField(blank=True, default='', max_length=150, null=True)), - ('sdate', models.DateField(default=datetime.date.today, verbose_name='Date')), - ('edate', models.DateField(blank=True, null=True)), - ('unique_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='Course', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('course_name', models.CharField(default='', max_length=100)), - ('description', models.TextField(blank=True, default='', max_length=250, null=True)), - ('license_no', models.CharField(blank=True, default='', max_length=100, null=True)), - ('sdate', models.DateField(default=datetime.date.today, verbose_name='Date')), - ('edate', models.DateField(blank=True, null=True)), - ('unique_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='Conference', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('conference_name', models.CharField(default='', max_length=100)), - ('description', models.TextField(blank=True, default='', max_length=250, null=True)), - ('sdate', models.DateField(default=datetime.date.today, verbose_name='Date')), - ('edate', models.DateField(blank=True, null=True)), - ('unique_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='Coinventor', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('coinventor_name', models.CharField(default='', max_length=100)), - ('patent_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='placement_cell.patent')), - ], - ), - migrations.CreateModel( - name='Coauthor', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('coauthor_name', models.CharField(default='', max_length=100)), - ('publication_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='placement_cell.publication')), - ], - ), - migrations.CreateModel( - name='Achievement', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('achievement', models.CharField(default='', max_length=100)), - ('achievement_type', models.CharField(choices=[('EDUCATIONAL', 'Educational'), ('OTHER', 'Other')], default='OTHER', max_length=20)), - ('description', models.TextField(blank=True, default='', max_length=1000, null=True)), - ('issuer', models.CharField(default='', max_length=200)), - ('date_earned', models.DateField(default=datetime.date.today, verbose_name='Date')), - ('unique_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - ), - migrations.CreateModel( - name='StudentRecord', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('record_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='placement_cell.placementrecord')), - ('unique_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'unique_together': {('record_id', 'unique_id')}, - }, - ), - migrations.CreateModel( - name='PlacementStatus', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('invitation', models.CharField(choices=[('ACCEPTED', 'Accepted'), ('REJECTED', 'Rejected'), ('PENDING', 'Pending'), ('IGNORE', 'IGNORE')], default='PENDING', max_length=20)), - ('placed', models.CharField(choices=[('NOT PLACED', 'Not Placed'), ('PLACED', 'Placed')], default='NOT PLACED', max_length=20)), - ('timestamp', models.DateTimeField(auto_now=True)), - ('no_of_days', models.IntegerField(blank=True, default=10, null=True)), - ('notify_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='placement_cell.notifystudent')), - ('unique_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'unique_together': {('notify_id', 'unique_id')}, - }, - ), - migrations.CreateModel( - name='Has', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('skill_rating', models.IntegerField(default=80)), - ('skill_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='placement_cell.skill')), - ('unique_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'unique_together': {('skill_id', 'unique_id')}, - }, - ), - ] diff --git a/FusionIIIT/applications/placement_cell/migrations/__init__.py b/FusionIIIT/applications/placement_cell/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/programme_curriculum/.DS_Store b/FusionIIIT/applications/programme_curriculum/.DS_Store new file mode 100644 index 000000000..ac80fdd68 Binary files /dev/null and b/FusionIIIT/applications/programme_curriculum/.DS_Store differ diff --git a/FusionIIIT/applications/programme_curriculum/migrations/0001_initial.py b/FusionIIIT/applications/programme_curriculum/migrations/0001_initial.py deleted file mode 100644 index b01ec58a7..000000000 --- a/FusionIIIT/applications/programme_curriculum/migrations/0001_initial.py +++ /dev/null @@ -1,142 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('globals', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Curriculum', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=100)), - ('version', models.PositiveIntegerField(default=1)), - ('working_curriculum', models.BooleanField(default=True)), - ('no_of_semester', models.PositiveIntegerField(default=1)), - ('min_credit', models.PositiveIntegerField(default=0)), - ], - ), - migrations.CreateModel( - name='Programme', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('category', models.CharField(choices=[('UG', 'Undergraduate'), ('PG', 'Postgraduate'), ('PHD', 'Doctor of Philosophy')], max_length=3)), - ('name', models.CharField(max_length=70, unique=True)), - ('programme_begin_year', models.PositiveIntegerField(default=2023)), - ], - ), - migrations.CreateModel( - name='Semester', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('semester_no', models.PositiveIntegerField()), - ('instigate_semester', models.BooleanField(default=False, null=True)), - ('start_semester', models.DateField(blank=True, null=True)), - ('end_semester', models.DateField(blank=True, null=True)), - ('semester_info', models.TextField(blank=True, null=True)), - ('curriculum', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.curriculum')), - ], - options={ - 'unique_together': {('curriculum', 'semester_no')}, - }, - ), - migrations.CreateModel( - name='Discipline', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=100, unique=True)), - ('acronym', models.CharField(default='', max_length=10)), - ('programmes', models.ManyToManyField(blank=True, to='programme_curriculum.Programme')), - ], - ), - migrations.AddField( - model_name='curriculum', - name='programme', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.programme'), - ), - migrations.CreateModel( - name='Course', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('code', models.CharField(max_length=10, unique=True)), - ('name', models.CharField(max_length=100, unique=True)), - ('credit', models.PositiveIntegerField(default=0)), - ('lecture_hours', models.PositiveIntegerField(null=True)), - ('tutorial_hours', models.PositiveIntegerField(null=True)), - ('pratical_hours', models.PositiveIntegerField(null=True)), - ('discussion_hours', models.PositiveIntegerField(null=True)), - ('project_hours', models.PositiveIntegerField(null=True)), - ('pre_requisits', models.TextField(blank=True, null=True)), - ('syllabus', models.TextField()), - ('percent_quiz_1', models.PositiveIntegerField(default=10)), - ('percent_midsem', models.PositiveIntegerField(default=20)), - ('percent_quiz_2', models.PositiveIntegerField(default=10)), - ('percent_endsem', models.PositiveIntegerField(default=30)), - ('percent_project', models.PositiveIntegerField(default=15)), - ('percent_lab_evaluation', models.PositiveIntegerField(default=10)), - ('percent_course_attendance', models.PositiveIntegerField(default=5)), - ('ref_books', models.TextField()), - ('working_course', models.BooleanField(default=True)), - ('disciplines', models.ManyToManyField(blank=True, to='programme_curriculum.Discipline')), - ('pre_requisit_courses', models.ManyToManyField(blank=True, related_name='_course_pre_requisit_courses_+', to='programme_curriculum.Course')), - ], - options={ - 'unique_together': {('code', 'name')}, - }, - ), - migrations.CreateModel( - name='Batch', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(choices=[('B.Tech', 'B.Tech'), ('M.Tech', 'M.Tech'), ('B.Des', 'B.Des'), ('M.Des', 'M.Des'), ('Phd', 'Phd')], max_length=50)), - ('year', models.PositiveIntegerField(default=2023)), - ('running_batch', models.BooleanField(default=True)), - ('curriculum', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='programme_curriculum.curriculum')), - ('discipline', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.discipline')), - ], - options={ - 'unique_together': {('name', 'discipline', 'year')}, - }, - ), - migrations.AlterUniqueTogether( - name='curriculum', - unique_together={('name', 'version')}, - ), - migrations.CreateModel( - name='CourseSlot', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=100)), - ('type', models.CharField(choices=[('Professional Core', 'Professional Core'), ('Professional Elective', 'Professional Elective'), ('Professional Lab', 'Professional Lab'), ('Engineering Science', 'Engineering Science'), ('Natural Science', 'Natural Science'), ('Humanities', 'Humanities'), ('Design', 'Design'), ('Manufacturing', 'Manufacturing'), ('Management Science', 'Management Science'), ('Optional Elective', 'Optional Elective'), ('Project', 'Project'), ('Optional', 'Optional'), ('Others', 'Others')], max_length=70)), - ('course_slot_info', models.TextField(null=True)), - ('duration', models.PositiveIntegerField(default=1)), - ('min_registration_limit', models.PositiveIntegerField(default=0)), - ('max_registration_limit', models.PositiveIntegerField(default=1000)), - ('courses', models.ManyToManyField(blank=True, to='programme_curriculum.Course')), - ('semester', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.semester')), - ], - options={ - 'unique_together': {('semester', 'name', 'type')}, - }, - ), - migrations.CreateModel( - name='CourseInstructor', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('batch_id', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.batch')), - ('course_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='programme_curriculum.course')), - ('instructor_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - options={ - 'unique_together': {('course_id', 'instructor_id', 'batch_id')}, - }, - ), - ] diff --git a/FusionIIIT/applications/programme_curriculum/migrations/__init__.py b/FusionIIIT/applications/programme_curriculum/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/programme_curriculum/models.py b/FusionIIIT/applications/programme_curriculum/models.py index 248079cd3..733217fff 100644 --- a/FusionIIIT/applications/programme_curriculum/models.py +++ b/FusionIIIT/applications/programme_curriculum/models.py @@ -7,6 +7,7 @@ from django.utils.translation import gettext_lazy as _ from django.core.exceptions import ValidationError from applications.globals.models import ExtraInfo +from django.core.validators import MinValueValidator, MaxValueValidator, DecimalValidator # Create your models here. @@ -26,7 +27,8 @@ ('Design', 'Design'), ('Manufacturing', 'Manufacturing'), ('Management Science', 'Management Science'), - ('Optional Elective', 'Optional Elective'), + ('Open Elective', 'Open Elective'), + ('Swayam','Swayam'), ('Project', 'Project'), ('Optional', 'Optional'), ('Others', 'Others') @@ -59,7 +61,7 @@ class Programme(models.Model): name = models.CharField(max_length=70, null=False, unique=True, blank=False) programme_begin_year = models.PositiveIntegerField(default=datetime.date.today().year, null=False) - def __str__(self): + def _str_(self): return str(self.category + " - "+ self.name) @property @@ -90,7 +92,7 @@ class Discipline(models.Model): acronym = models.CharField(max_length=10, null=False, default="", blank=False) programmes = models.ManyToManyField(Programme, blank=True) - def __str__(self): + def _str_(self): return str(self.name) + " " + str(self.acronym) @property @@ -117,7 +119,11 @@ class Curriculum(models.Model): ''' programme = models.ForeignKey(Programme, on_delete=models.CASCADE, null=False) name = models.CharField(max_length=100, null=False, blank=False) - version = models.PositiveIntegerField(default=1, null=False) + version = models.DecimalField( + max_digits=2, + decimal_places=1, + default=1.0, + validators=[MinValueValidator(1.0), DecimalValidator(max_digits=2, decimal_places=1)]) working_curriculum = models.BooleanField(default=True, null=False) no_of_semester = models.PositiveIntegerField(default=1, null=False) min_credit = models.PositiveIntegerField(default=0, null=False) @@ -125,7 +131,7 @@ class Curriculum(models.Model): class Meta: unique_together = ('name', 'version',) - def __str__(self): + def _str_(self): return str(self.name + " v" + str(self.version)) @property @@ -166,8 +172,8 @@ class Semester(models.Model): class Meta: unique_together = ('curriculum', 'semester_no',) - def __str__(self): - return str(Curriculum.__str__(self.curriculum) + ", sem-" + str(self.semester_no)) + def _str_(self): + return str(Curriculum._str_(self.curriculum) + ", sem-" + str(self.semester_no)) @property def courseslots(self): @@ -207,8 +213,13 @@ class Course(models.Model): ''' - code = models.CharField(max_length=10, null=False, unique=True, blank=False) - name = models.CharField(max_length=100, null=False, unique=True, blank=False) + code = models.CharField(max_length=10, null=False, blank=False) + name = models.CharField(max_length=100, null=False, blank=False) + version = models.DecimalField( + max_digits=2, + decimal_places=1, + default=1.0, + validators=[MinValueValidator(1.0), DecimalValidator(max_digits=2, decimal_places=1)]) credit = models.PositiveIntegerField(default=0, null=False, blank=False) lecture_hours = PositiveIntegerField(null=True, ) tutorial_hours = PositiveIntegerField(null=True) @@ -228,12 +239,14 @@ class Course(models.Model): ref_books = models.TextField() working_course = models.BooleanField(default=True) disciplines = models.ManyToManyField(Discipline, blank=True) + latest_version = models.BooleanField(default=True) class Meta: - unique_together = ('code', 'name',) + unique_together = ('code','version') - def __str__(self): - return str(self.code + " - " +self.name) + def _str_(self): + return str(self.code + " - " +self.name+"- v"+str(self.version)) + @property def courseslots(self): @@ -268,7 +281,7 @@ class Batch(models.Model): class Meta: unique_together = ('name', 'discipline', 'year',) - def __str__(self): + def _str_(self): return str(self.name) + " " + str(self.discipline.acronym) + " " + str(self.year) @@ -277,11 +290,6 @@ class CourseSlot(models.Model): Current Purpose : To store the details regarding a course slot Course slot : is defined as per the curriculum for a programme to have specific type of courses for a given semester - - - - - ATTRIBUTES : semester(programme_curriculum.Semester) - [not nullable] to denote link to the semester details for which the courseslot is made @@ -304,8 +312,8 @@ class CourseSlot(models.Model): max_registration_limit = models.PositiveIntegerField(default = 1000) - def __str__(self): - return str(Semester.__str__(self.semester) + ", " + self.name) + def _str_(self): + return str(Semester._str_(self.semester) + ", " + self.name) class Meta: unique_together = ('semester', 'name', 'type') @@ -324,6 +332,5 @@ class Meta: unique_together = ('course_id', 'instructor_id', 'batch_id') - def __self__(self): - return '{} - {}'.format(self.course_id, self.instructor_id) - \ No newline at end of file + def _self_(self): + return '{} - {}'.format(self.course_id, self.instructor_id) \ No newline at end of file diff --git a/FusionIIIT/applications/ps1/.DS_Store b/FusionIIIT/applications/ps1/.DS_Store new file mode 100644 index 000000000..4ed28c5b4 Binary files /dev/null and b/FusionIIIT/applications/ps1/.DS_Store differ diff --git a/FusionIIIT/applications/ps1/migrations/0001_initial.py b/FusionIIIT/applications/ps1/migrations/0001_initial.py deleted file mode 100644 index 4cd74fe33..000000000 --- a/FusionIIIT/applications/ps1/migrations/0001_initial.py +++ /dev/null @@ -1,58 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('filetracking', '0001_initial'), - ('globals', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='IndentFile', - fields=[ - ('file_info', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='filetracking.file')), - ('item_name', models.CharField(max_length=250)), - ('quantity', models.IntegerField()), - ('present_stock', models.IntegerField()), - ('estimated_cost', models.IntegerField(null=True)), - ('purpose', models.CharField(max_length=250)), - ('specification', models.CharField(max_length=250)), - ('indent_type', models.CharField(max_length=250)), - ('nature', models.BooleanField(default=False)), - ('indigenous', models.BooleanField(default=False)), - ('replaced', models.BooleanField(default=False)), - ('budgetary_head', models.CharField(max_length=250)), - ('expected_delivery', models.DateField()), - ('sources_of_supply', models.CharField(max_length=250)), - ('head_approval', models.BooleanField(default=False)), - ('director_approval', models.BooleanField(default=False)), - ('financial_approval', models.BooleanField(default=False)), - ('purchased', models.BooleanField(default=False)), - ], - options={ - 'db_table': 'IndentFile', - }, - ), - migrations.CreateModel( - name='StockEntry', - fields=[ - ('item_id', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='ps1.indentfile')), - ('vendor', models.CharField(max_length=250)), - ('item_name', models.CharField(max_length=250)), - ('current_stock', models.IntegerField()), - ('recieved_date', models.DateField()), - ('bill', models.FileField(upload_to='')), - ('dealing_assistant_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - options={ - 'db_table': 'StockEntry', - }, - ), - ] diff --git a/FusionIIIT/applications/ps1/migrations/__init__.py b/FusionIIIT/applications/ps1/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/recruitment/.DS_Store b/FusionIIIT/applications/recruitment/.DS_Store new file mode 100644 index 000000000..4ed28c5b4 Binary files /dev/null and b/FusionIIIT/applications/recruitment/.DS_Store differ diff --git a/FusionIIIT/applications/recruitment/migrations/0001_initial.py b/FusionIIIT/applications/recruitment/migrations/0001_initial.py deleted file mode 100644 index 9cf2d3a77..000000000 --- a/FusionIIIT/applications/recruitment/migrations/0001_initial.py +++ /dev/null @@ -1,311 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -import datetime -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import django.utils.timezone - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.CreateModel( - name='EducationalDetails', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('university', models.CharField(max_length=200)), - ('board', models.CharField(max_length=200)), - ('year_of_passing', models.IntegerField()), - ('division', models.CharField(max_length=6)), - ], - ), - migrations.CreateModel( - name='Experience', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('duration', models.IntegerField(null=True)), - ('organization', models.CharField(max_length=100, null=True)), - ('area', models.CharField(max_length=200, null=True)), - ], - ), - migrations.CreateModel( - name='Vacancy', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('advertisement_number', models.IntegerField()), - ('job_description', models.TextField()), - ('job_notification', models.FileField(upload_to='')), - ('number_of_vacancy', models.IntegerField(default=1)), - ('job_type', models.CharField(choices=[('T', 'Teaching'), ('NT', 'Non-Teaching')], max_length=15)), - ('last_date', models.DateField()), - ], - ), - migrations.CreateModel( - name='ThesisSupervision', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name_of_student', models.CharField(max_length=200)), - ('masters_or_phd', models.CharField(choices=[('Masters', 'Masters'), ('PhD', 'PhD')], max_length=20)), - ('year_of_completion', models.IntegerField()), - ('title_of_thesis', models.CharField(max_length=100)), - ('co_guides', models.CharField(max_length=200, null=True)), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='TeachingExperience', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('teaching_experience', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='recruitment.experience')), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='SponsoredProjects', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('period', models.CharField(max_length=10)), - ('sponsoring_organisation', models.CharField(max_length=200)), - ('title_of_project', models.CharField(max_length=200)), - ('grant_amount', models.IntegerField(null=True)), - ('co_investigators', models.CharField(max_length=200, null=True)), - ('status', models.CharField(choices=[('Ongoing', 'Ongoing'), ('Completed', 'Completed')], max_length=20)), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='ResearchExperience', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('research_experience', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='recruitment.experience')), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='References', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=100)), - ('address', models.TextField(null=True)), - ('email', models.EmailField(max_length=254)), - ('mobile_number', models.BigIntegerField()), - ('department', models.CharField(max_length=50)), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='QualifiedExams', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('net', models.BooleanField()), - ('gate', models.BooleanField()), - ('jrf', models.BooleanField()), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Publications', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('referred_journal', models.CharField(max_length=100)), - ('sci_index_journal', models.CharField(max_length=100)), - ('international_conferences', models.CharField(max_length=100, null=True)), - ('national_conferences', models.CharField(max_length=100, null=True)), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='PersonalDetails', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('title', models.CharField(default='Dr.', max_length=20)), - ('sex', models.CharField(choices=[('M', 'Male'), ('F', 'Female'), ('O', 'Other')], default='M', max_length=2)), - ('profile_picture', models.ImageField(blank=True, null=True, upload_to='')), - ('marital_status', models.CharField(choices=[('M', 'Married'), ('U', 'Unmarried')], max_length=10)), - ('discipline', models.CharField(max_length=50)), - ('specialization', models.CharField(choices=[('MA', 'Major'), ('MI', 'Minor')], max_length=10)), - ('category', models.CharField(choices=[('PH', 'Physically Handicapped'), ('UR', 'Unreserved'), ('OBC', 'Other Backward Classes'), ('SC', 'Scheduled Castes'), ('ST', 'Scheduled Tribes'), ('EWS', 'Economic Weaker Section')], max_length=20)), - ('father_name', models.CharField(default='', max_length=40)), - ('address_correspondence', models.TextField(max_length=1000)), - ('address_permanent', models.TextField(default='', max_length=1000)), - ('email_alternate', models.EmailField(default='', max_length=50, null=True)), - ('phone_no', models.BigIntegerField(default=9999999999, null=True)), - ('mobile_no_first', models.BigIntegerField(default=9999999999)), - ('mobile_no_second', models.BigIntegerField(default=9999999999, null=True)), - ('date_of_birth', models.DateField(default=datetime.date(1970, 1, 1))), - ('nationality', models.CharField(max_length=30)), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Patent', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('filed_national', models.CharField(max_length=200, null=True)), - ('filed_international', models.CharField(max_length=200, null=True)), - ('award_national', models.CharField(max_length=200, null=True)), - ('award_international', models.CharField(max_length=200, null=True)), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='PapersInReferredJournal', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('author', models.CharField(max_length=100)), - ('year', models.IntegerField()), - ('published', models.BooleanField()), - ('accepted', models.BooleanField()), - ('title', models.CharField(max_length=100)), - ('reference_of_journal', models.CharField(max_length=100)), - ('impact_factor', models.CharField(max_length=100)), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='NationalConference', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('author', models.CharField(max_length=100)), - ('year', models.IntegerField()), - ('title', models.CharField(max_length=100)), - ('name_and_place_of_conference', models.CharField(max_length=200)), - ('presented', models.BooleanField()), - ('published', models.BooleanField()), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='InternationalConference', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('author', models.CharField(max_length=100)), - ('year', models.IntegerField()), - ('title', models.CharField(max_length=100)), - ('name_and_place_of_conference', models.CharField(max_length=200)), - ('presented', models.BooleanField()), - ('published', models.BooleanField()), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='IndustrialExperience', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('period', models.IntegerField(null=True)), - ('organization', models.CharField(max_length=200, null=True)), - ('title_of_post', models.CharField(max_length=200, null=True)), - ('nature_of_work', models.TextField(null=True)), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='ExperienceDetails', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('total_experience_months', models.IntegerField(null=True)), - ('member_of_professional_body', models.CharField(max_length=200, null=True)), - ('employer', models.CharField(max_length=100, null=True)), - ('position_held', models.CharField(max_length=100, null=True)), - ('date_of_joining', models.DateField(null=True)), - ('date_of_leaving', models.DateField(null=True)), - ('pay_in_payband', models.CharField(max_length=20, null=True)), - ('payband', models.CharField(max_length=20, null=True)), - ('AGP', models.CharField(max_length=20, null=True)), - ('reasons_for_leaving', models.TextField(null=True)), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='CoursesTaught', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('title', models.CharField(max_length=100, null=True)), - ('level', models.CharField(choices=[('UG', 'UnderGraduate'), ('PG', 'PostGraduate')], max_length=20, null=True)), - ('number_of_times', models.IntegerField(null=True)), - ('developed_by_you', models.BooleanField(null=True)), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Consultancy', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('period', models.CharField(max_length=10)), - ('sponsoring_organisation', models.CharField(max_length=200)), - ('title_of_project', models.CharField(max_length=200)), - ('grant_amount', models.IntegerField(null=True)), - ('co_investigators', models.CharField(max_length=200, null=True)), - ('status', models.CharField(choices=[('Ongoing', 'Ongoing'), ('Completed', 'Completed')], max_length=20)), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Books', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name_of_book', models.CharField(max_length=100)), - ('year', models.IntegerField()), - ('published', models.BooleanField()), - ('title', models.CharField(max_length=100)), - ('publisher', models.CharField(max_length=200)), - ('co_author', models.CharField(max_length=100, null=True)), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='BankDetails', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('payment_reference_number', models.CharField(max_length=20)), - ('payment_date', models.DateField()), - ('bank_name', models.CharField(max_length=100)), - ('bank_branch', models.CharField(max_length=200)), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='applied', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date', models.DateField(default=django.utils.timezone.now)), - ('advertisement_number', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='recruitment.vacancy')), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='AdministrativeExperience', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('period', models.IntegerField(null=True)), - ('organization', models.CharField(max_length=200, null=True)), - ('title_of_post', models.CharField(max_length=200, null=True)), - ('nature_of_work', models.TextField(null=True)), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='AcademicDetails', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('area_of_specialization', models.TextField()), - ('current_area_of_research', models.TextField()), - ('date_of_enrollment_in_phd', models.DateField()), - ('date_of_phd_defence', models.DateField()), - ('date_of_award_of_phd', models.DateField()), - ('XIIth', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='XIIth_details', to='recruitment.educationaldetails')), - ('Xth', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='Xth_details', to='recruitment.educationaldetails')), - ('graduation', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='graduation_details', to='recruitment.educationaldetails')), - ('phd', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='phd_details', to='recruitment.educationaldetails')), - ('post_graduation', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='post_graduations_details', to='recruitment.educationaldetails')), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - ] diff --git a/FusionIIIT/applications/recruitment/migrations/__init__.py b/FusionIIIT/applications/recruitment/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/research_procedures/.DS_Store b/FusionIIIT/applications/research_procedures/.DS_Store new file mode 100644 index 000000000..8cf2d457d Binary files /dev/null and b/FusionIIIT/applications/research_procedures/.DS_Store differ diff --git a/FusionIIIT/applications/research_procedures/migrations/0001_initial.py b/FusionIIIT/applications/research_procedures/migrations/0001_initial.py deleted file mode 100644 index ec4b77a48..000000000 --- a/FusionIIIT/applications/research_procedures/migrations/0001_initial.py +++ /dev/null @@ -1,91 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -import datetime -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('globals', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='TechTransfer', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pf_no', models.IntegerField()), - ('details', models.CharField(default=' ', max_length=500)), - ('date_entry', models.DateField(blank=True, default=datetime.datetime.now, null=True)), - ('start_date', models.DateField(blank=True, null=True)), - ('end_date', models.DateField(blank=True, null=True)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='ResearchProject', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pf_no', models.IntegerField()), - ('ptype', models.CharField(default='Research', max_length=100)), - ('pi', models.CharField(default=' ', max_length=1000)), - ('co_pi', models.CharField(default=' ', max_length=1500)), - ('title', models.TextField(default=' ', max_length=5000)), - ('funding_agency', models.CharField(default=' ', max_length=250, null=True)), - ('financial_outlay', models.CharField(default=' ', max_length=150, null=True)), - ('status', models.CharField(choices=[('Awarded', 'Awarded'), ('Submitted', 'Submitted'), ('Ongoing', 'Ongoing'), ('Completed', 'Completed')], max_length=10)), - ('start_date', models.DateField(blank=True, null=True)), - ('finish_date', models.DateField(blank=True, null=True)), - ('date_submission', models.DateField(blank=True, null=True)), - ('date_entry', models.DateField(blank=True, default=datetime.datetime.now, null=True)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='ResearchGroup', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=120)), - ('description', models.TextField()), - ('faculty_under_group', models.ManyToManyField(related_name='allfaculty', to=settings.AUTH_USER_MODEL)), - ('students_under_group', models.ManyToManyField(related_name='allstudents', to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Patent', - fields=[ - ('application_id', models.AutoField(primary_key=True, serialize=False)), - ('title', models.CharField(max_length=120)), - ('ipd_form', models.FileField(blank=True, null=True, upload_to='')), - ('project_details', models.FileField(blank=True, null=True, upload_to='')), - ('ipd_form_file', models.TextField(blank=True, null=True)), - ('project_details_file', models.TextField(blank=True, null=True)), - ('status', models.CharField(choices=[('Approved', 'Approved'), ('Disapproved', 'Disapproved'), ('Pending', 'Pending')], default='Pending', max_length=20)), - ('faculty_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - ), - migrations.CreateModel( - name='ConsultancyProject', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pf_no', models.IntegerField()), - ('consultants', models.CharField(max_length=150)), - ('title', models.CharField(max_length=1000)), - ('client', models.CharField(max_length=1000)), - ('financial_outlay', models.IntegerField()), - ('start_date', models.DateField(blank=True, null=True)), - ('end_date', models.DateField(blank=True, null=True)), - ('duration', models.CharField(blank=True, max_length=500, null=True)), - ('date_entry', models.DateField(blank=True, default=datetime.datetime.now, null=True)), - ('status', models.CharField(blank=True, choices=[('Completed', 'Completed'), ('Submitted', 'Submitted'), ('Ongoing', 'Ongoing')], default='Ongoing', max_length=10, null=True)), - ('remarks', models.CharField(blank=True, max_length=1000, null=True)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - ] diff --git a/FusionIIIT/applications/research_procedures/migrations/__init__.py b/FusionIIIT/applications/research_procedures/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/scholarships/.DS_Store b/FusionIIIT/applications/scholarships/.DS_Store new file mode 100644 index 000000000..804399843 Binary files /dev/null and b/FusionIIIT/applications/scholarships/.DS_Store differ diff --git a/FusionIIIT/applications/scholarships/migrations/0001_initial.py b/FusionIIIT/applications/scholarships/migrations/0001_initial.py deleted file mode 100644 index 176422fd9..000000000 --- a/FusionIIIT/applications/scholarships/migrations/0001_initial.py +++ /dev/null @@ -1,233 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -import datetime -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('academic_information', '0001_initial'), - ('globals', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Award_and_scholarship', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('award_name', models.CharField(default='', max_length=100)), - ('catalog', models.TextField(max_length=5000)), - ], - options={ - 'db_table': 'Award_and_scholarship', - }, - ), - migrations.CreateModel( - name='Release', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date_time', models.DateTimeField(blank=True, default=datetime.datetime.now)), - ('programme', models.CharField(default='B.Tech', max_length=10)), - ('startdate', models.DateField(default=datetime.date.today)), - ('enddate', models.DateField()), - ('award', models.CharField(default='', max_length=50)), - ('remarks', models.TextField(default='', max_length=500)), - ('batch', models.TextField(default='all')), - ('notif_visible', models.IntegerField(default=1)), - ], - options={ - 'db_table': 'Release', - }, - ), - migrations.CreateModel( - name='Proficiency_dm', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('relevant_document', models.FileField(blank=True, null=True, upload_to='')), - ('title_name', models.CharField(max_length=30, null=True)), - ('award_type', models.CharField(max_length=50, null=True)), - ('status', models.CharField(choices=[('Complete', 'COMPLETE'), ('Incomplete', 'INCOMPLETE'), ('Reject', 'REJECT'), ('Accept', 'ACCEPT')], default='INCOMPLETE', max_length=10)), - ('no_of_students', models.IntegerField(default=1)), - ('date', models.DateField(default=datetime.date.today)), - ('roll_no1', models.IntegerField(default=0)), - ('roll_no2', models.IntegerField(default=0)), - ('roll_no3', models.IntegerField(default=0)), - ('roll_no4', models.IntegerField(default=0)), - ('roll_no5', models.IntegerField(default=0)), - ('brief_description', models.TextField(max_length=1000, null=True)), - ('justification', models.TextField(max_length=1000, null=True)), - ('ece_topic', models.CharField(max_length=25, null=True)), - ('cse_topic', models.CharField(max_length=25, null=True)), - ('mech_topic', models.CharField(max_length=25, null=True)), - ('design_topic', models.CharField(max_length=25, null=True)), - ('ece_percentage', models.IntegerField(null=True)), - ('cse_percentage', models.IntegerField(null=True)), - ('mech_percentage', models.IntegerField(null=True)), - ('design_percentage', models.IntegerField(null=True)), - ('correspondence_address', models.CharField(max_length=100, null=True)), - ('financial_assistance', models.TextField(max_length=1000, null=True)), - ('grand_total', models.IntegerField(null=True)), - ('nearest_policestation', models.CharField(max_length=25, null=True)), - ('nearest_railwaystation', models.CharField(max_length=25, null=True)), - ('award_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='scholarships.award_and_scholarship')), - ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'Proficiency_dm', - }, - ), - migrations.CreateModel( - name='Previous_winner', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('programme', models.CharField(default='B.Tech', max_length=10)), - ('year', models.IntegerField(default=2023)), - ('award_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='scholarships.award_and_scholarship')), - ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'Previous_winner', - }, - ), - migrations.CreateModel( - name='Notional_prize', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('spi', models.FloatField()), - ('cpi', models.FloatField()), - ('year', models.CharField(choices=[('UG1', 'UG1'), ('UG2', 'UG2'), ('UG3', 'UG3'), ('UG4', 'UG4'), ('PG1', 'PG1'), ('PG2', 'PG2')], max_length=10)), - ('award_id', models.ForeignKey(default=4, on_delete=django.db.models.deletion.CASCADE, to='scholarships.award_and_scholarship')), - ], - options={ - 'db_table': 'Notional_prize', - }, - ), - migrations.CreateModel( - name='Notification', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('notification_mcm_flag', models.BooleanField(default=False)), - ('notification_convocation_flag', models.BooleanField(default=False)), - ('invite_mcm_accept_flag', models.BooleanField(default=False)), - ('invite_convocation_accept_flag', models.BooleanField(default=False)), - ('release_id', models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='scholarships.release')), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'Notification', - }, - ), - migrations.CreateModel( - name='Mcm', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('brother_name', models.CharField(max_length=30, null=True)), - ('brother_occupation', models.TextField(max_length=100, null=True)), - ('sister_name', models.CharField(max_length=30, null=True)), - ('sister_occupation', models.TextField(max_length=100, null=True)), - ('income_father', models.IntegerField(default=0)), - ('income_mother', models.IntegerField(default=0)), - ('income_other', models.IntegerField(default=0)), - ('father_occ', models.CharField(choices=[('government', 'Government'), ('private', 'Private'), ('public', 'Public'), ('business', 'Business'), ('medical', 'Medical'), ('consultant', 'Consultant'), ('pensioners', 'Pensioners')], default='', max_length=10)), - ('mother_occ', models.CharField(choices=[('EMPLOYED', 'EMPLOYED'), ('HOUSE_WIFE', 'HOUSE_WIFE')], default='', max_length=10)), - ('father_occ_desc', models.CharField(max_length=30, null=True)), - ('mother_occ_desc', models.CharField(max_length=30, null=True)), - ('four_wheeler', models.IntegerField(blank=True, null=True)), - ('four_wheeler_desc', models.CharField(max_length=30, null=True)), - ('two_wheeler', models.IntegerField(blank=True, null=True)), - ('two_wheeler_desc', models.CharField(max_length=30, null=True)), - ('house', models.CharField(max_length=10, null=True)), - ('plot_area', models.IntegerField(blank=True, null=True)), - ('constructed_area', models.IntegerField(blank=True, null=True)), - ('school_fee', models.IntegerField(blank=True, null=True)), - ('school_name', models.CharField(max_length=30, null=True)), - ('bank_name', models.CharField(max_length=100, null=True)), - ('loan_amount', models.IntegerField(blank=True, null=True)), - ('college_fee', models.IntegerField(blank=True, null=True)), - ('college_name', models.CharField(max_length=30, null=True)), - ('income_certificate', models.FileField(blank=True, null=True, upload_to='')), - ('forms', models.FileField(blank=True, null=True, upload_to='')), - ('status', models.CharField(choices=[('Complete', 'COMPLETE'), ('Incomplete', 'INCOMPLETE'), ('Reject', 'REJECT'), ('Accept', 'ACCEPT')], default='INCOMPLETE', max_length=10)), - ('annual_income', models.IntegerField(default=0)), - ('date', models.DateField(default=datetime.date.today)), - ('award_id', models.ForeignKey(default=4, on_delete=django.db.models.deletion.CASCADE, to='scholarships.award_and_scholarship')), - ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='mcm_info', to='academic_information.student')), - ], - options={ - 'db_table': 'Mcm', - }, - ), - migrations.CreateModel( - name='Director_silver', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('nearest_policestation', models.TextField(default='station', max_length=30)), - ('nearest_railwaystation', models.TextField(default='station', max_length=30)), - ('correspondence_address', models.TextField(max_length=150, null=True)), - ('award_type', models.CharField(max_length=50, null=True)), - ('status', models.CharField(choices=[('Complete', 'COMPLETE'), ('Incomplete', 'INCOMPLETE'), ('Reject', 'REJECT'), ('Accept', 'ACCEPT')], default='INCOMPLETE', max_length=10)), - ('relevant_document', models.FileField(blank=True, null=True, upload_to='')), - ('date', models.DateField(default=datetime.date.today)), - ('financial_assistance', models.TextField(max_length=1000, null=True)), - ('grand_total', models.IntegerField(null=True)), - ('inside_achievements', models.TextField(max_length=1000, null=True)), - ('justification', models.TextField(max_length=1000, null=True)), - ('outside_achievements', models.TextField(max_length=1000, null=True)), - ('award_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='scholarships.award_and_scholarship')), - ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'Director_silver', - }, - ), - migrations.CreateModel( - name='Director_gold', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('status', models.CharField(choices=[('Complete', 'COMPLETE'), ('Incomplete', 'INCOMPLETE'), ('Reject', 'REJECT'), ('Accept', 'ACCEPT')], default='INCOMPLETE', max_length=10)), - ('relevant_document', models.FileField(blank=True, null=True, upload_to='')), - ('date', models.DateField(default=datetime.date.today)), - ('academic_achievements', models.TextField(max_length=1000, null=True)), - ('science_inside', models.TextField(max_length=1000, null=True)), - ('science_outside', models.TextField(max_length=1000, null=True)), - ('games_inside', models.TextField(max_length=1000, null=True)), - ('games_outside', models.TextField(max_length=1000, null=True)), - ('cultural_inside', models.TextField(max_length=1000, null=True)), - ('cultural_outside', models.TextField(max_length=1000, null=True)), - ('social', models.TextField(max_length=1000, null=True)), - ('corporate', models.TextField(max_length=1000, null=True)), - ('hall_activities', models.TextField(max_length=1000, null=True)), - ('gymkhana_activities', models.TextField(max_length=1000, null=True)), - ('institute_activities', models.TextField(max_length=1000, null=True)), - ('counselling_activities', models.TextField(max_length=1000, null=True)), - ('other_activities', models.TextField(max_length=1000, null=True)), - ('justification', models.TextField(max_length=1000, null=True)), - ('correspondence_address', models.CharField(max_length=100, null=True)), - ('financial_assistance', models.TextField(max_length=1000, null=True)), - ('grand_total', models.IntegerField(null=True)), - ('nearest_policestation', models.CharField(max_length=25, null=True)), - ('nearest_railwaystation', models.CharField(max_length=25, null=True)), - ('award_id', models.ForeignKey(default=4, on_delete=django.db.models.deletion.CASCADE, to='scholarships.award_and_scholarship')), - ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')), - ], - options={ - 'db_table': 'Director_gold', - }, - ), - migrations.CreateModel( - name='Application', - fields=[ - ('application_id', models.CharField(max_length=100, primary_key=True, serialize=False)), - ('applied_flag', models.BooleanField(default=False)), - ('award', models.CharField(max_length=30)), - ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.extrainfo')), - ], - options={ - 'db_table': 'Application', - }, - ), - ] diff --git a/FusionIIIT/applications/scholarships/migrations/__init__.py b/FusionIIIT/applications/scholarships/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/applications/visitor_hostel/.DS_Store b/FusionIIIT/applications/visitor_hostel/.DS_Store new file mode 100644 index 000000000..34e5e2229 Binary files /dev/null and b/FusionIIIT/applications/visitor_hostel/.DS_Store differ diff --git a/FusionIIIT/applications/visitor_hostel/migrations/0001_initial.py b/FusionIIIT/applications/visitor_hostel/migrations/0001_initial.py deleted file mode 100644 index f4229feb2..000000000 --- a/FusionIIIT/applications/visitor_hostel/migrations/0001_initial.py +++ /dev/null @@ -1,134 +0,0 @@ -# Generated by Django 3.1.5 on 2023-03-15 18:53 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import django.utils.timezone - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.CreateModel( - name='BookingDetail', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('visitor_category', models.CharField(choices=[('A', 'A'), ('B', 'B'), ('C', 'C'), ('D', 'D')], default='C', max_length=1)), - ('modified_visitor_category', models.CharField(choices=[('A', 'A'), ('B', 'B'), ('C', 'C'), ('D', 'D')], default='C', max_length=1)), - ('person_count', models.IntegerField(default=1)), - ('purpose', models.TextField(default='Hi!')), - ('booking_from', models.DateField()), - ('booking_to', models.DateField()), - ('arrival_time', models.TextField(blank=True, null=True)), - ('departure_time', models.TextField(blank=True, null=True)), - ('forwarded_date', models.DateField(blank=True, null=True)), - ('confirmed_date', models.DateField(blank=True, null=True)), - ('check_in', models.DateField(blank=True, null=True)), - ('check_out', models.DateField(blank=True, null=True)), - ('check_in_time', models.TimeField(blank=True, null=True)), - ('check_out_time', models.TimeField(blank=True, null=True)), - ('status', models.CharField(choices=[('Confirmed', 'Confirmed'), ('Pending', 'Pending'), ('Rejected', 'Rejected'), ('Canceled', 'Canceled'), ('CancelRequested', 'CancelRequested'), ('CheckedIn', 'CheckedIn'), ('Complete', 'Complete'), ('Forward', 'Forward')], default='Pending', max_length=15)), - ('remark', models.CharField(blank=True, max_length=40, null=True)), - ('image', models.FileField(blank=True, null=True, upload_to='VhImage/')), - ('number_of_rooms', models.IntegerField(blank=True, default=1, null=True)), - ('number_of_rooms_alloted', models.IntegerField(blank=True, default=1, null=True)), - ('booking_date', models.DateField(default=django.utils.timezone.now)), - ('bill_to_be_settled_by', models.CharField(choices=[('Intender', 'Intender'), ('Visitor', 'Visitor'), ('ProjectNo', 'ProjectNo'), ('Institute', 'Institute')], default='Intender', max_length=15)), - ('caretaker', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='caretaker', to=settings.AUTH_USER_MODEL)), - ('intender', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='intender', to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Inventory', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('item_name', models.CharField(max_length=20)), - ('quantity', models.IntegerField(default=0)), - ('consumable', models.BooleanField(default=False)), - ('opening_stock', models.IntegerField(default=0)), - ('addition_stock', models.IntegerField(default=0)), - ('total_stock', models.IntegerField(default=0)), - ('serviceable', models.IntegerField(default=0)), - ('non_serviceable', models.IntegerField(default=0)), - ('inuse', models.IntegerField(default=0)), - ('total_usable', models.IntegerField(default=0)), - ('remark', models.TextField(blank=True)), - ], - ), - migrations.CreateModel( - name='VisitorDetail', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('visitor_phone', models.CharField(max_length=15)), - ('visitor_name', models.CharField(max_length=40)), - ('visitor_email', models.CharField(blank=True, max_length=40)), - ('visitor_organization', models.CharField(blank=True, max_length=100)), - ('visitor_address', models.TextField(blank=True)), - ('nationality', models.CharField(blank=True, max_length=20)), - ], - ), - migrations.CreateModel( - name='RoomDetail', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('room_number', models.CharField(max_length=4, unique=True)), - ('room_type', models.CharField(choices=[('SingleBed', 'SingleBed'), ('DoubleBed', 'DoubleBed'), ('VIP', 'VIP')], max_length=12)), - ('room_floor', models.CharField(choices=[('GroundFloor', 'GroundFloor'), ('FirstFloor', 'FirstFloor'), ('SecondFloor', 'SecondFloor'), ('ThirdFloor', 'ThirdFloor')], max_length=12)), - ('room_status', models.CharField(choices=[('Booked', 'Booked'), ('CheckedIn', 'CheckedIn'), ('Available', 'Available'), ('UnderMaintenance', 'UnderMaintenance')], default='Available', max_length=20)), - ('visitor', models.ManyToManyField(blank=True, to='visitor_hostel.VisitorDetail')), - ], - ), - migrations.CreateModel( - name='MealRecord', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('meal_date', models.DateField()), - ('morning_tea', models.BooleanField(default=False)), - ('eve_tea', models.BooleanField(default=False)), - ('breakfast', models.BooleanField(default=False)), - ('lunch', models.BooleanField(default=False)), - ('dinner', models.BooleanField(default=False)), - ('persons', models.IntegerField(default=0)), - ('booking', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='visitor_hostel.bookingdetail')), - ('room', models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='visitor_hostel.roomdetail')), - ('visitor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='visitor_hostel.visitordetail')), - ], - ), - migrations.CreateModel( - name='InventoryBill', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('bill_number', models.CharField(max_length=40)), - ('cost', models.IntegerField(default=0)), - ('item_name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='visitor_hostel.inventory')), - ], - ), - migrations.AddField( - model_name='bookingdetail', - name='rooms', - field=models.ManyToManyField(to='visitor_hostel.RoomDetail'), - ), - migrations.AddField( - model_name='bookingdetail', - name='visitor', - field=models.ManyToManyField(to='visitor_hostel.VisitorDetail'), - ), - migrations.CreateModel( - name='Bill', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('meal_bill', models.IntegerField(default=0)), - ('room_bill', models.IntegerField(default=0)), - ('payment_status', models.BooleanField(default=False)), - ('booking', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='visitor_hostel.bookingdetail')), - ('caretaker', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ('room', models.ManyToManyField(to='visitor_hostel.RoomDetail')), - ], - ), - ] diff --git a/FusionIIIT/applications/visitor_hostel/migrations/__init__.py b/FusionIIIT/applications/visitor_hostel/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/media/feeds/profile_pictures/Snapchat-1401287705.jpg b/FusionIIIT/media/feeds/profile_pictures/Snapchat-1401287705.jpg deleted file mode 100644 index 4dc7ab350..000000000 Binary files a/FusionIIIT/media/feeds/profile_pictures/Snapchat-1401287705.jpg and /dev/null differ diff --git a/FusionIIIT/media/feeds/profile_pictures/rahul.jpg b/FusionIIIT/media/feeds/profile_pictures/rahul.jpg deleted file mode 100644 index e9a3f8fd0..000000000 Binary files a/FusionIIIT/media/feeds/profile_pictures/rahul.jpg and /dev/null differ diff --git a/FusionIIIT/media/feeds/profile_pictures/sid.jpg b/FusionIIIT/media/feeds/profile_pictures/sid.jpg deleted file mode 100644 index d18c7e75e..000000000 Binary files a/FusionIIIT/media/feeds/profile_pictures/sid.jpg and /dev/null differ diff --git a/FusionIIIT/media/sample_a2In3HQ.jpg b/FusionIIIT/media/sample_a2In3HQ.jpg deleted file mode 100644 index 0a18df12f..000000000 Binary files a/FusionIIIT/media/sample_a2In3HQ.jpg and /dev/null differ diff --git a/FusionIIIT/media/sample_maFMAz9.jpg b/FusionIIIT/media/sample_maFMAz9.jpg deleted file mode 100644 index 0a18df12f..000000000 Binary files a/FusionIIIT/media/sample_maFMAz9.jpg and /dev/null differ diff --git a/FusionIIIT/notification/views.py b/FusionIIIT/notification/views.py index 0480575b8..eb44d474b 100644 --- a/FusionIIIT/notification/views.py +++ b/FusionIIIT/notification/views.py @@ -1,4 +1,5 @@ from django.shortcuts import render +from requests import Response from notifications.signals import notify # Create your views here. @@ -69,6 +70,7 @@ def central_mess_notif(sender, recipient, type, message=None): sender = sender recipient = recipient verb = '' + if type == 'feedback_submitted': verb = 'Your feedback has been successfully submitted.' elif type == 'menu_change_accepted': @@ -125,8 +127,6 @@ def healthcare_center_notif(sender, recipient, type): if type == 'amb_req': verb = "You have a new ambulance request" - - notify.send(sender=sender, recipient=recipient, url=url, module=module, verb=verb) @@ -336,7 +336,21 @@ def department_notif(sender, recipient, type): sender = sender recipient = recipient verb = type - flag = "department" + flag = "announcement" + + notify.send(sender=sender, + recipient=recipient, + url=url, + module=module, + verb=verb, + flag=flag) +def examination_notif(sender, recipient, type): + url='examination:examination' + module='examination' + sender = sender + recipient = recipient + verb = type + flag = "announcement" notify.send(sender=sender, recipient=recipient, @@ -384,4 +398,28 @@ def research_procedures_notif(sender,recipient,type): elif type == "created": verb = "A new Patent has been Created" + notify.send(sender=sender,recipient=recipient,url=url,module=module,verb=verb) + +def hostel_notifications(sender, recipient, type): + url = 'hostelmanagement:hostel_view' + module = 'Hostel Management' + + sender = sender + recipient = recipient + verb = "" + if type == "leave_accept": + verb = "Your leave request has been Accepted." + elif type == "leave_reject": + verb = "Your leave request has been Rejected." + elif type == "guestRoom_accept": + verb = "Your Guest Room request has been Accepted." + elif type == "guestRoom_reject": + verb = "Your Guest Room request has been Rejected." + elif type == "leave_request": + verb = "You have a new Leave Request." + elif type == "guestRoom_request": + verb = "You have a new Guest Room Request." + elif type == "fine_imposed": + verb = "A fine has been imposed on you." + notify.send(sender=sender,recipient=recipient,url=url,module=module,verb=verb) \ No newline at end of file diff --git a/FusionIIIT/templates/.DS_Store b/FusionIIIT/templates/.DS_Store new file mode 100644 index 000000000..1c991a0cd Binary files /dev/null and b/FusionIIIT/templates/.DS_Store differ diff --git a/FusionIIIT/templates/academic_procedures/academic.html b/FusionIIIT/templates/academic_procedures/academic.html old mode 100755 new mode 100644 index 6b04a54fb..35eebf446 --- a/FusionIIIT/templates/academic_procedures/academic.html +++ b/FusionIIIT/templates/academic_procedures/academic.html @@ -22,6 +22,39 @@ } + + {% endblock css %} @@ -30,13 +63,12 @@ {% include 'dashboard/navbar.html' %} {% endblock %} -
+
- {% comment %}The left-margin segment!{% endcomment %} -
+ {% comment %}The left-rail segment starts here!{% endcomment %} -
+
{% comment %}The user image card starts here!{% endcomment %} {% block usercard %} {% include 'globals/usercard.html' %} @@ -46,8 +78,8 @@
{% comment %}The Tab-Menu starts here!{% endcomment %} -