From c950f49b1bc35717fd5ebb5adc02abcdf193ae9c Mon Sep 17 00:00:00 2001 From: "Puliuvarthi.Mahesh" <134507390+MaheshPulivarthi18@users.noreply.github.com> Date: Fri, 16 Feb 2024 10:42:33 +0530 Subject: [PATCH 1/2] use cases init --- FusionIIIT/Fusion/settings/development.py | 39 ++- .../migrations/0002_auto_20240115_1651.py | 38 +++ .../eis/migrations/0002_auto_20240115_1651.py | 53 ++++ .../migrations/0002_auto_20240115_1651.py | 18 ++ .../migrations/0003_auto_20240210_1752.py | 18 ++ .../migrations/0004_auto_20240212_1537.py | 18 ++ .../migrations/0005_auto_20240212_2152.py | 18 ++ .../migrations/0006_auto_20240212_2215.py | 18 ++ .../migrations/0007_auto_20240213_0036.py | 18 ++ .../migrations/0008_auto_20240213_1739.py | 18 ++ .../migrations/0009_auto_20240214_1648.py | 18 ++ .../migrations/0010_auto_20240214_1808.py | 19 ++ FusionIIIT/applications/globals/models.py | 2 +- .../migrations/0002_auto_20240214_1808.py | 33 +++ FusionIIIT/applications/gymkhana/models.py | 265 +++++++++--------- FusionIIIT/applications/gymkhana/views.py | 93 +++--- FusionIIIT/applications/iwdModuleV2/urls.py | 2 - .../migrations/0002_auto_20240115_1651.py | 23 ++ .../migrations/0002_auto_20240115_1651.py | 18 ++ .../templates/gymkhanaModule/active_poll.html | 36 +-- .../templates/gymkhanaModule/create_poll.html | 38 +-- requirements.txt => requirements1.txt | 18 +- 22 files changed, 575 insertions(+), 246 deletions(-) create mode 100644 FusionIIIT/applications/academic_procedures/migrations/0002_auto_20240115_1651.py create mode 100644 FusionIIIT/applications/eis/migrations/0002_auto_20240115_1651.py create mode 100644 FusionIIIT/applications/globals/migrations/0002_auto_20240115_1651.py create mode 100644 FusionIIIT/applications/globals/migrations/0003_auto_20240210_1752.py create mode 100644 FusionIIIT/applications/globals/migrations/0004_auto_20240212_1537.py create mode 100644 FusionIIIT/applications/globals/migrations/0005_auto_20240212_2152.py create mode 100644 FusionIIIT/applications/globals/migrations/0006_auto_20240212_2215.py create mode 100644 FusionIIIT/applications/globals/migrations/0007_auto_20240213_0036.py create mode 100644 FusionIIIT/applications/globals/migrations/0008_auto_20240213_1739.py create mode 100644 FusionIIIT/applications/globals/migrations/0009_auto_20240214_1648.py create mode 100644 FusionIIIT/applications/globals/migrations/0010_auto_20240214_1808.py create mode 100644 FusionIIIT/applications/gymkhana/migrations/0002_auto_20240214_1808.py create mode 100644 FusionIIIT/applications/programme_curriculum/migrations/0002_auto_20240115_1651.py create mode 100644 FusionIIIT/applications/scholarships/migrations/0002_auto_20240115_1651.py rename requirements.txt => requirements1.txt (88%) diff --git a/FusionIIIT/Fusion/settings/development.py b/FusionIIIT/Fusion/settings/development.py index 6acc214c1..3c5a1323d 100644 --- a/FusionIIIT/Fusion/settings/development.py +++ b/FusionIIIT/Fusion/settings/development.py @@ -2,45 +2,40 @@ DEBUG = True -SECRET_KEY = '=&w9due426k@l^ju1=s1)fj1rnpf0ok8xvjwx+62_nc-f12-8(' +SECRET_KEY = "=&w9due426k@l^ju1=s1)fj1rnpf0ok8xvjwx+62_nc-f12-8(" -ALLOWED_HOSTS = ['*'] +ALLOWED_HOSTS = ["*"] DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'fusionlab', - 'HOST': os.environ.get("DB_HOST", default='localhost'), - 'USER': 'fusion_admin', - 'PASSWORD': 'hello123', + "default": { + "ENGINE": "django.db.backends.postgresql_psycopg2", + "NAME": "fusionlab", + "HOST": os.environ.get("DB_HOST", default="localhost"), + "USER": "fusion_admin", + "PASSWORD": "hello123", } } REST_FRAMEWORK = { - 'DEFAULT_AUTHENTICATION_CLASSES': ( - 'rest_framework.authentication.TokenAuthentication', + "DEFAULT_AUTHENTICATION_CLASSES": ( + "rest_framework.authentication.TokenAuthentication", ), - 'DEFAULT_PERMISSION_CLASSES': ( - 'rest_framework.permissions.IsAuthenticated', - ) + "DEFAULT_PERMISSION_CLASSES": ("rest_framework.permissions.IsAuthenticated",), } if DEBUG: - MIDDLEWARE += ( - 'debug_toolbar.middleware.DebugToolbarMiddleware', - ) + MIDDLEWARE += ("debug_toolbar.middleware.DebugToolbarMiddleware",) INSTALLED_APPS += ( - 'debug_toolbar', - 'django_extensions', - ) - + "debug_toolbar", + "django_extensions", + ) ############################### # DJANGO_EXTENSIONS SETTINGS: # ############################### INTERNAL_IPS = [ - '127.0.0.1', + "127.0.0.1", ] ############################### @@ -51,5 +46,5 @@ SHELL_PLUS_PRINT_SQL = True DEBUG_TOOLBAR_CONFIG = { - 'INTERCEPT_REDIRECTS': False, + "INTERCEPT_REDIRECTS": False, } diff --git a/FusionIIIT/applications/academic_procedures/migrations/0002_auto_20240115_1651.py b/FusionIIIT/applications/academic_procedures/migrations/0002_auto_20240115_1651.py new file mode 100644 index 000000000..4468e53b3 --- /dev/null +++ b/FusionIIIT/applications/academic_procedures/migrations/0002_auto_20240115_1651.py @@ -0,0 +1,38 @@ +# Generated by Django 3.1.5 on 2024-01-15 16:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('academic_procedures', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='assistantshipclaim', + name='year', + field=models.IntegerField(choices=[(2024, 2024), (2023, 2023)]), + ), + migrations.AlterField( + model_name='course_registration', + name='working_year', + field=models.IntegerField(blank=True, choices=[(2024, 2024), (2023, 2023)], null=True), + ), + migrations.AlterField( + model_name='finalregistrations', + name='batch', + field=models.IntegerField(default=2024), + ), + migrations.AlterField( + model_name='messdue', + name='year', + field=models.IntegerField(choices=[(2024, 2024), (2023, 2023)]), + ), + migrations.AlterField( + model_name='register', + name='year', + field=models.IntegerField(default=2024), + ), + ] diff --git a/FusionIIIT/applications/eis/migrations/0002_auto_20240115_1651.py b/FusionIIIT/applications/eis/migrations/0002_auto_20240115_1651.py new file mode 100644 index 000000000..12cc5028f --- /dev/null +++ b/FusionIIIT/applications/eis/migrations/0002_auto_20240115_1651.py @@ -0,0 +1,53 @@ +# Generated by Django 3.1.5 on 2024-01-15 16:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('eis', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='emp_achievement', + name='a_year', + field=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), (2024, 2024)], null=True, verbose_name='year'), + ), + migrations.AlterField( + model_name='emp_confrence_organised', + name='k_year', + field=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), (2024, 2024)], null=True, verbose_name='year'), + ), + migrations.AlterField( + model_name='emp_expert_lectures', + name='l_year', + field=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), (2024, 2024)], null=True, verbose_name='year'), + ), + migrations.AlterField( + model_name='emp_keynote_address', + name='k_year', + field=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), (2024, 2024)], null=True, verbose_name='year'), + ), + migrations.AlterField( + model_name='emp_mtechphd_thesis', + name='s_year', + field=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), (2024, 2024)], null=True, verbose_name='year'), + ), + migrations.AlterField( + model_name='emp_patents', + name='p_year', + field=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), (2024, 2024)], null=True, verbose_name='year'), + ), + migrations.AlterField( + model_name='emp_published_books', + name='pyear', + field=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), (2024, 2024)], null=True, verbose_name='year'), + ), + migrations.AlterField( + model_name='emp_research_papers', + name='year', + field=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), (2024, 2024)], max_length=10, null=True), + ), + ] diff --git a/FusionIIIT/applications/globals/migrations/0002_auto_20240115_1651.py b/FusionIIIT/applications/globals/migrations/0002_auto_20240115_1651.py new file mode 100644 index 000000000..e7c68233d --- /dev/null +++ b/FusionIIIT/applications/globals/migrations/0002_auto_20240115_1651.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.5 on 2024-01-15 16:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('globals', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='extrainfo', + name='user_status', + field=models.CharField(choices=[('NEW', 'NEW'), ('PRESENT', 'PRESENT')], default='PRESENT', max_length=50), + ), + ] diff --git a/FusionIIIT/applications/globals/migrations/0003_auto_20240210_1752.py b/FusionIIIT/applications/globals/migrations/0003_auto_20240210_1752.py new file mode 100644 index 000000000..50441b81b --- /dev/null +++ b/FusionIIIT/applications/globals/migrations/0003_auto_20240210_1752.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.5 on 2024-02-10 17:52 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('globals', '0002_auto_20240115_1651'), + ] + + operations = [ + migrations.AlterField( + model_name='extrainfo', + name='user_status', + field=models.CharField(choices=[('PRESENT', 'PRESENT'), ('NEW', 'NEW')], default='PRESENT', max_length=50), + ), + ] diff --git a/FusionIIIT/applications/globals/migrations/0004_auto_20240212_1537.py b/FusionIIIT/applications/globals/migrations/0004_auto_20240212_1537.py new file mode 100644 index 000000000..0e5541cb3 --- /dev/null +++ b/FusionIIIT/applications/globals/migrations/0004_auto_20240212_1537.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.5 on 2024-02-12 15:37 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('globals', '0003_auto_20240210_1752'), + ] + + operations = [ + migrations.AlterField( + model_name='extrainfo', + name='user_status', + field=models.CharField(choices=[('NEW', 'NEW'), ('PRESENT', 'PRESENT')], default='PRESENT', max_length=50), + ), + ] diff --git a/FusionIIIT/applications/globals/migrations/0005_auto_20240212_2152.py b/FusionIIIT/applications/globals/migrations/0005_auto_20240212_2152.py new file mode 100644 index 000000000..e5cb98c49 --- /dev/null +++ b/FusionIIIT/applications/globals/migrations/0005_auto_20240212_2152.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.5 on 2024-02-12 21:52 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('globals', '0004_auto_20240212_1537'), + ] + + operations = [ + migrations.AlterField( + model_name='extrainfo', + name='user_status', + field=models.CharField(choices=[('PRESENT', 'PRESENT'), ('NEW', 'NEW')], default='PRESENT', max_length=50), + ), + ] diff --git a/FusionIIIT/applications/globals/migrations/0006_auto_20240212_2215.py b/FusionIIIT/applications/globals/migrations/0006_auto_20240212_2215.py new file mode 100644 index 000000000..ab252a31d --- /dev/null +++ b/FusionIIIT/applications/globals/migrations/0006_auto_20240212_2215.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.5 on 2024-02-12 22:15 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('globals', '0005_auto_20240212_2152'), + ] + + operations = [ + migrations.AlterField( + model_name='extrainfo', + name='user_status', + field=models.CharField(choices=[('NEW', 'NEW'), ('PRESENT', 'PRESENT')], default='PRESENT', max_length=50), + ), + ] diff --git a/FusionIIIT/applications/globals/migrations/0007_auto_20240213_0036.py b/FusionIIIT/applications/globals/migrations/0007_auto_20240213_0036.py new file mode 100644 index 000000000..f5984571a --- /dev/null +++ b/FusionIIIT/applications/globals/migrations/0007_auto_20240213_0036.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.5 on 2024-02-13 00:36 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('globals', '0006_auto_20240212_2215'), + ] + + operations = [ + migrations.AlterField( + model_name='extrainfo', + name='user_status', + field=models.CharField(choices=[('PRESENT', 'PRESENT'), ('NEW', 'NEW')], default='PRESENT', max_length=50), + ), + ] diff --git a/FusionIIIT/applications/globals/migrations/0008_auto_20240213_1739.py b/FusionIIIT/applications/globals/migrations/0008_auto_20240213_1739.py new file mode 100644 index 000000000..e710bc7c6 --- /dev/null +++ b/FusionIIIT/applications/globals/migrations/0008_auto_20240213_1739.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.5 on 2024-02-13 17:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('globals', '0007_auto_20240213_0036'), + ] + + operations = [ + migrations.AlterField( + model_name='extrainfo', + name='user_status', + field=models.CharField(choices=[('NEW', 'NEW'), ('PRESENT', 'PRESENT')], default='PRESENT', max_length=50), + ), + ] diff --git a/FusionIIIT/applications/globals/migrations/0009_auto_20240214_1648.py b/FusionIIIT/applications/globals/migrations/0009_auto_20240214_1648.py new file mode 100644 index 000000000..f935078e8 --- /dev/null +++ b/FusionIIIT/applications/globals/migrations/0009_auto_20240214_1648.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.5 on 2024-02-14 16:48 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('globals', '0008_auto_20240213_1739'), + ] + + operations = [ + migrations.AlterField( + model_name='extrainfo', + name='user_status', + field=models.CharField(choices=[('PRESENT', 'PRESENT'), ('NEW', 'NEW')], default='PRESENT', max_length=50), + ), + ] diff --git a/FusionIIIT/applications/globals/migrations/0010_auto_20240214_1808.py b/FusionIIIT/applications/globals/migrations/0010_auto_20240214_1808.py new file mode 100644 index 000000000..00b23336e --- /dev/null +++ b/FusionIIIT/applications/globals/migrations/0010_auto_20240214_1808.py @@ -0,0 +1,19 @@ +# Generated by Django 3.1.5 on 2024-02-14 18:08 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('globals', '0009_auto_20240214_1648'), + ] + + operations = [ + migrations.AlterField( + model_name='extrainfo', + name='department', + field=models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to='globals.departmentinfo'), + ), + ] diff --git a/FusionIIIT/applications/globals/models.py b/FusionIIIT/applications/globals/models.py index 31eedcfb4..ba982a0e1 100644 --- a/FusionIIIT/applications/globals/models.py +++ b/FusionIIIT/applications/globals/models.py @@ -149,7 +149,7 @@ class ExtraInfo(models.Model): phone_no = models.BigIntegerField(null=True, default=9999999999) user_type = models.CharField(max_length=20, choices=Constants.USER_CHOICES) department = models.ForeignKey( - DepartmentInfo, on_delete=models.CASCADE, null=True, blank=True) + DepartmentInfo, on_delete=models.CASCADE, null=False, blank=True) profile_picture = models.ImageField( null=True, blank=True, upload_to='globals/profile_pictures') about_me = models.TextField(default='NA', max_length=1000, blank=True) diff --git a/FusionIIIT/applications/gymkhana/migrations/0002_auto_20240214_1808.py b/FusionIIIT/applications/gymkhana/migrations/0002_auto_20240214_1808.py new file mode 100644 index 000000000..5089e68d9 --- /dev/null +++ b/FusionIIIT/applications/gymkhana/migrations/0002_auto_20240214_1808.py @@ -0,0 +1,33 @@ +# Generated by Django 3.1.5 on 2024-02-14 18:08 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('gymkhana', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='club_info', + name='created_on', + field=models.DateField(default=None), + ), + migrations.AddField( + model_name='club_info', + name='head_changed_on', + field=models.DateField(default=None), + ), + migrations.AlterField( + model_name='registration_form', + name='roll', + field=models.CharField(default='20160017', max_length=8, primary_key=True, serialize=False), + ), + migrations.AlterField( + model_name='session_info', + name='end_time', + field=models.TimeField(default=None), + ), + ] diff --git a/FusionIIIT/applications/gymkhana/models.py b/FusionIIIT/applications/gymkhana/models.py index c4513b236..caaf126bb 100644 --- a/FusionIIIT/applications/gymkhana/models.py +++ b/FusionIIIT/applications/gymkhana/models.py @@ -19,34 +19,31 @@ # # Class for various choices on the enumerations class Constants: available = ( - ('On', 'On'), - ('Off', 'Off'), + ("On", "On"), + ("Off", "Off"), ) categoryCh = ( - ('Technical', 'Technical'), - ('Sports', 'Sports'), - ('Cultural', 'Cultural') - ) - status = ( - ('open', 'Open'), - ('confirmed', 'Confirmed'), - ('rejected', 'Rejected') - ) - fest = ( - ('Abhikalpan', 'Abhikalpan'), - ('Gusto', 'Gusto'), - ('Tarang', 'Tarang') + ("Technical", "Technical"), + ("Sports", "Sports"), + ("Cultural", "Cultural"), ) + status = (("open", "Open"), ("confirmed", "Confirmed"), ("rejected", "Rejected")) + fest = (("Abhikalpan", "Abhikalpan"), ("Gusto", "Gusto"), ("Tarang", "Tarang")) venue = ( - ('Classroom', ( - ('CR101', 'CR101'), - ('CR102', 'CR102'), - )), - ('Lecturehall', ( - ('L101', 'L101'), - ('L102', 'L102'), - )), - + ( + "Classroom", + ( + ("CR101", "CR101"), + ("CR102", "CR102"), + ), + ), + ( + "Lecturehall", + ( + ("L101", "L101"), + ("L102", "L102"), + ), + ), ) @@ -58,7 +55,7 @@ class Club_info(models.Model): club_name - name of the club club_website - url of the club website - category - to which category it belongs to + category - to which category it belongs to co_ordinator - refers to the id of co_ordinator of the club co_coordinator - refers to the id of co_coordinator of the club faculty_incharge - the lecturer/proffesor who is incharge of this club. @@ -66,41 +63,50 @@ class Club_info(models.Model): activity_calender - it is the url of club logo description - refers to brief explanation about the club alloted_budget - the amount alloted to the club - spent_budget - the amount spent by the club + spent_budget - the amount spent by the club avail_budget - the amount available at the club status - status of club wheather it is confirmed or not - + """ + club_name = models.CharField(max_length=50, null=False, primary_key=True) club_website = models.CharField(max_length=150, null=True, default="hello") - category = models.CharField( - max_length=50, null=False, choices=Constants.categoryCh) - co_ordinator = models.ForeignKey(Student, on_delete=models.CASCADE, null=False, related_name='co_of') + category = models.CharField(max_length=50, null=False, choices=Constants.categoryCh) + co_ordinator = models.ForeignKey( + Student, on_delete=models.CASCADE, null=False, related_name="co_of" + ) co_coordinator = models.ForeignKey( - Student, on_delete=models.CASCADE, null=False, related_name='coco_of') + Student, on_delete=models.CASCADE, null=False, related_name="coco_of" + ) faculty_incharge = models.ForeignKey( - Faculty, on_delete=models.CASCADE, null=False, related_name='faculty_incharge_of') - club_file = models.FileField(upload_to='gymkhana/club_poster', null=True) + Faculty, + on_delete=models.CASCADE, + null=False, + related_name="faculty_incharge_of", + ) + club_file = models.FileField(upload_to="gymkhana/club_poster", null=True) activity_calender = models.FileField( - upload_to='gymkhana/activity_calender', null=True, default=" ") + upload_to="gymkhana/activity_calender", null=True, default=" " + ) description = models.TextField(max_length=256, null=True) alloted_budget = models.IntegerField(null=True, default=0) spent_budget = models.IntegerField(null=True, default=0) avail_budget = models.IntegerField(null=True, default=0) - status = models.CharField( - max_length=50, choices=Constants.status, default='open') + status = models.CharField(max_length=50, choices=Constants.status, default="open") + head_changed_on = models.DateField(default=None, auto_now=False, null=False) + created_on = models.DateField(default=None, auto_now=False, null=False) def __str__(self): return str(self.club_name) class Meta: - db_table = 'Club_info' + db_table = "Club_info" class Form_available(models.Model): """ It stores registered form name , roll number and status. - + roll - roll number of the student status - it is a boolean value wheather the form is available or not form_name - name of the form @@ -109,13 +115,14 @@ class Form_available(models.Model): roll = models.CharField(default=2016001, max_length=7, primary_key=True) status = models.BooleanField(default=True, max_length=5) - form_name = models.CharField(default='senate_registration', max_length=30) + form_name = models.CharField(default="senate_registration", max_length=30) def __str__(self): return str(self.roll) class Meta: - db_table = 'Form_available' + db_table = "Form_available" + class Registration_form(models.Model): """ @@ -129,17 +136,17 @@ class Registration_form(models.Model): """ - roll = models.CharField(max_length=7, default="2016001", primary_key=True) + roll = models.CharField(max_length=8, default="20160017", primary_key=True) user_name = models.CharField(max_length=40, default="Student") - branch = models.CharField(max_length=20, default='open') + branch = models.CharField(max_length=20, default="open") cpi = models.FloatField(max_length=3, default=6.0) - programme = models.CharField(max_length=20, default='B.tech') + programme = models.CharField(max_length=20, default="B.tech") def __str__(self): return str(self.roll) class Meta: - db_table = 'Registration_form' + db_table = "Registration_form" class Club_member(models.Model): @@ -154,22 +161,23 @@ class Club_member(models.Model): remarks - remarks of the student by the club if any. """ + id = models.AutoField(primary_key=True) member = models.ForeignKey( - Student, on_delete=models.CASCADE, related_name='member_of') - club = models.ForeignKey(Club_info, on_delete=models.CASCADE, related_name='this_club', null=False) + Student, on_delete=models.CASCADE, related_name="member_of" + ) + club = models.ForeignKey( + Club_info, on_delete=models.CASCADE, related_name="this_club", null=False + ) description = models.TextField(max_length=256, null=True) - status = models.CharField( - max_length=50, choices=Constants.status, default='open') + status = models.CharField(max_length=50, choices=Constants.status, default="open") remarks = models.CharField(max_length=256, null=True) def __str__(self): return str(self.member.id) class Meta: - db_table = 'Club_member' - - + db_table = "Club_member" class Core_team(models.Model): @@ -186,13 +194,14 @@ class Core_team(models.Model): remarks - remarks(if there are any) in the fest """ + id = models.AutoField(primary_key=True) student_id = models.ForeignKey( - Student, on_delete=models.CASCADE, related_name='applied_for') + Student, on_delete=models.CASCADE, related_name="applied_for" + ) team = models.CharField(max_length=50, null=False) year = models.DateTimeField(max_length=6, null=True) - fest_name = models.CharField( - max_length=256, null=False, choices=Constants.fest) + fest_name = models.CharField(max_length=256, null=False, choices=Constants.fest) pda = models.TextField(max_length=256, null=False) remarks = models.CharField(max_length=256, null=True) @@ -200,38 +209,35 @@ def __str__(self): return str(self.student_id) class Meta: - db_table = 'Core_team' + db_table = "Core_team" class Club_budget(models.Model): - """ Records the budget details of the clubs. - id - serial number club - name of the club budget_for - the purpose of the budget,like for equipment or for event etc.., budget_amt - the amount required for the club budget_file - it is file which contains complete details regarding the amount they want to spend descrion - description about the budget if any - """ - id = models.AutoField(primary_key=True) - club = models.ForeignKey(Club_info,on_delete=models.CASCADE, max_length=50, null=False) + club = models.ForeignKey( + Club_info, on_delete=models.CASCADE, max_length=50, null=False + ) budget_for = models.CharField(max_length=256, null=False) budget_amt = models.IntegerField(default=0, null=False) - budget_file = models.FileField(upload_to='uploads/', null=False) + budget_file = models.FileField(upload_to="uploads/", null=False) description = models.TextField(max_length=256, null=False) - status = models.CharField( - max_length=50, choices=Constants.status, default='open') + status = models.CharField(max_length=50, choices=Constants.status, default="open") remarks = models.CharField(max_length=256, null=True) def __str__(self): return str(self.id) class Meta: - db_table = 'Club_budget' + db_table = "Club_budget" class Session_info(models.Model): @@ -241,31 +247,31 @@ class Session_info(models.Model): id - serial number club - name of the club venue - the place at which they conducting the session - date - date of the session + date - date of the session start_time - the time at which session starts end_time - the time at which session ends session_poster - the logo/poster for the session(image) details - for which purpose they are taking the session status - wheather it is approved/rejected. - """ id = models.AutoField(primary_key=True) - club = models.ForeignKey(Club_info, on_delete=models.CASCADE,max_length=50, null=True) - venue = models.CharField(max_length=50, null=False, - choices=Constants.venue) + club = models.ForeignKey( + Club_info, on_delete=models.CASCADE, max_length=50, null=True + ) + venue = models.CharField(max_length=50, null=False, choices=Constants.venue) date = models.DateField(default=None, auto_now=False, null=False) start_time = models.TimeField(default=None, auto_now=False, null=False) - end_time = models.TimeField(default=None, auto_now=False, null=True) - session_poster = models.ImageField(upload_to='gymkhana/session_poster', null=True) + end_time = models.TimeField(default=None, auto_now=False, null=False) + session_poster = models.ImageField(upload_to="gymkhana/session_poster", null=True) details = models.TextField(max_length=256, null=True) - status = models.CharField( - max_length=50, choices=Constants.status, default='open') + status = models.CharField(max_length=50, choices=Constants.status, default="open") def __str__(self): return str(self.id) class Meta: - db_table = 'Session_info' + db_table = "Session_info" + class Event_info(models.Model): """ @@ -286,24 +292,24 @@ class Event_info(models.Model): """ id = models.AutoField(primary_key=True) - club = models.ForeignKey(Club_info, on_delete=models.CASCADE,max_length=50, null=True) - event_name= models.CharField(max_length=256, null=False) - venue = models.CharField(max_length=50, null=False, - choices=Constants.venue) - incharge=models.CharField(max_length=256, null=False) + club = models.ForeignKey( + Club_info, on_delete=models.CASCADE, max_length=50, null=True + ) + event_name = models.CharField(max_length=256, null=False) + venue = models.CharField(max_length=50, null=False, choices=Constants.venue) + incharge = models.CharField(max_length=256, null=False) date = models.DateField(default=None, auto_now=False, null=False) start_time = models.TimeField(default=None, auto_now=False, null=False) end_time = models.TimeField(default=None, auto_now=False, null=True) - event_poster = models.FileField(upload_to='gymkhana/event_poster', blank=True) + event_poster = models.FileField(upload_to="gymkhana/event_poster", blank=True) details = models.TextField(max_length=256, null=True) - status = models.CharField( - max_length=50, choices=Constants.status, default='open') + status = models.CharField(max_length=50, choices=Constants.status, default="open") def __str__(self): return str(self.id) class Meta: - db_table = 'Event_info' + db_table = "Event_info" class Club_report(models.Model): @@ -322,19 +328,22 @@ class Club_report(models.Model): """ id = models.AutoField(primary_key=True) - club = models.ForeignKey(Club_info, on_delete=models.CASCADE,max_length=50, null=False) - incharge = models.ForeignKey(ExtraInfo, on_delete=models.CASCADE,max_length=256, null=False) + club = models.ForeignKey( + Club_info, on_delete=models.CASCADE, max_length=50, null=False + ) + incharge = models.ForeignKey( + ExtraInfo, on_delete=models.CASCADE, max_length=256, null=False + ) event_name = models.CharField(max_length=50, null=False) - date = models.DateTimeField( - max_length=50, default=timezone.now, blank=True) - event_details = models.FileField(upload_to='uploads/', null=False) + date = models.DateTimeField(max_length=50, default=timezone.now, blank=True) + event_details = models.FileField(upload_to="uploads/", null=False) description = models.TextField(max_length=256, null=True) def __str__(self): return str(self.id) class Meta: - db_table = 'Club_report' + db_table = "Club_report" class Fest_budget(models.Model): @@ -349,56 +358,57 @@ class Fest_budget(models.Model): description - brief explanation regarding budget if any status - wheather budget is approved or rejected remarks - negative things regarding budget - + """ id = models.AutoField(primary_key=True) fest = models.CharField(max_length=50, null=False, choices=Constants.fest) budget_amt = models.IntegerField(default=0, null=False) - budget_file = models.FileField(upload_to='uploads/', null=False) + budget_file = models.FileField(upload_to="uploads/", null=False) year = models.CharField(max_length=10, null=True) description = models.TextField(max_length=256, null=False) - status = models.CharField( - max_length=50, choices=Constants.status, default='open') + status = models.CharField(max_length=50, choices=Constants.status, default="open") remarks = models.CharField(max_length=256, null=True) def __str__(self): return str(self.id) class Meta: - db_table = 'Fest_budget' + db_table = "Fest_budget" class Other_report(models.Model): """ This model also stores details of the events conducting by all clubs irrespective of the clubs. - + id - serial number incharge - name of faculty who is incharge for the event date - date of the event event_details - for which purpose they are conducting the event - description - brief explanation about event if needed + description - brief explanation about event if needed """ + id = models.AutoField(primary_key=True) - incharge = models.ForeignKey(ExtraInfo, on_delete=models.CASCADE,max_length=256, null=False) + incharge = models.ForeignKey( + ExtraInfo, on_delete=models.CASCADE, max_length=256, null=False + ) event_name = models.CharField(max_length=50, null=False) - date = models.DateTimeField( - max_length=50, default=timezone.now, blank=True) - event_details = models.FileField(upload_to='uploads/', null=False) + date = models.DateTimeField(max_length=50, default=timezone.now, blank=True) + event_details = models.FileField(upload_to="uploads/", null=False) description = models.TextField(max_length=256, null=True) def __str__(self): return str(self.id) class Meta: - db_table = 'Other_report' + db_table = "Other_report" class Change_office(models.Model): """ - + id - serial number club - name of the club @@ -410,15 +420,19 @@ class Change_office(models.Model): remarks - remarks if there are any. """ + id = models.AutoField(primary_key=True) - club = models.ForeignKey(Club_info, on_delete=models.CASCADE,max_length=50, null=False) - co_ordinator = models.ForeignKey(User, on_delete=models.CASCADE,null=False, related_name='co_of') + club = models.ForeignKey( + Club_info, on_delete=models.CASCADE, max_length=50, null=False + ) + co_ordinator = models.ForeignKey( + User, on_delete=models.CASCADE, null=False, related_name="co_of" + ) co_coordinator = models.ForeignKey( - User, on_delete=models.CASCADE, null=False, related_name='coco_of') - status = models.CharField( - max_length=50, choices=Constants.status, default='open') - date_request = models.DateTimeField( - max_length=50, default=timezone.now, blank=True) + User, on_delete=models.CASCADE, null=False, related_name="coco_of" + ) + status = models.CharField(max_length=50, choices=Constants.status, default="open") + date_request = models.DateTimeField(max_length=50, default=timezone.now, blank=True) date_approve = models.DateTimeField(max_length=50, blank=True) remarks = models.CharField(max_length=256, null=True) @@ -426,7 +440,7 @@ def __str__(self): return self.id class Meta: - db_table = 'Change_office' + db_table = "Change_office" class Voting_polls(models.Model): @@ -441,21 +455,23 @@ class Voting_polls(models.Model): groups - the groups that are participating in the voting """ - - title = models.CharField(max_length=200,null=False) - description = models.CharField(max_length=5000,null=False) + + title = models.CharField(max_length=200, null=False) + description = models.CharField(max_length=5000, null=False) pub_date = models.DateTimeField(default=timezone.now) exp_date = models.DateTimeField(default=timezone.now) - created_by = models.CharField(max_length=100,null=True) - groups = models.CharField(max_length=500,default='{}') - + created_by = models.CharField(max_length=100, null=True) + groups = models.CharField(max_length=500, default="{}") + def groups_data(self): return self.groups def __str__(self): return self.title + class Meta: - ordering = ['-pub_date'] + ordering = ["-pub_date"] + class Voting_choices(models.Model): """ @@ -467,15 +483,16 @@ class Voting_choices(models.Model): """ poll_event = models.ForeignKey(Voting_polls, on_delete=models.CASCADE) - title = models.CharField(max_length=200,null=False) - description = models.CharField(max_length=500,default='') + title = models.CharField(max_length=200, null=False) + description = models.CharField(max_length=500, default="") votes = models.IntegerField(default=0) def __str__(self): return self.title - + class Meta: - get_latest_by = 'votes' + get_latest_by = "votes" + class Voting_voters(models.Model): """ @@ -485,11 +502,9 @@ class Voting_voters(models.Model): student_id - roll number of student """ - + poll_event = models.ForeignKey(Voting_polls, on_delete=models.CASCADE) student_id = models.CharField(max_length=50, null=False) - - + def __str__(self): return self.student_id - diff --git a/FusionIIIT/applications/gymkhana/views.py b/FusionIIIT/applications/gymkhana/views.py index 7f54215bb..90c2c8e0b 100644 --- a/FusionIIIT/applications/gymkhana/views.py +++ b/FusionIIIT/applications/gymkhana/views.py @@ -473,7 +473,6 @@ def new_club(request): return redirect('/gymkhana/') - @login_required() def form_avail(request): """ @@ -988,8 +987,6 @@ def act_calender(request): return HttpResponse(content) - - @login_required def club_report(request): """ @@ -1106,7 +1103,6 @@ def change_head(request): # return redirect('/gymkhana/') - @login_required def new_session(request): """ @@ -1263,35 +1259,50 @@ def fest_budget(request): @login_required def approve(request): - """ - This view is used by the clubs to approve the students who wants to join the club and changes status of student to confirmed. - It gets a list of students who has to be approved and checks them and approves accordingly. - - @variables: - approve_list - list of students who has to be checked and approved. - remarks - gets remarks list if any remarks present - club_member - gets the object(club and student) and the confirms the status of student in the club. - """ - approve_list = list(request.POST.getlist('check')) - for user in approve_list: - # pos = lis.index(user) - remark = "remarks" + user - remarks = request.POST.getlist(remark) - user = user.split(',') - info = user[0].split(' - ') + """ + This view is used by the clubs to approve the students who want to join the club and changes the status of the student to 'confirmed'. + It gets a list of students who have to be approved and approves them accordingly. + """ + approve_list = list(request.POST.getlist("check")) + + for user in approve_list: + remark = "remarks" + user + remarks = request.POST.getlist(remark) + user = user.split(",") + info = user[0].split(" - ") + + # Retrieve User, ExtraInfo, and Student objects + user_name = get_object_or_404(User, username=info[1]) + extra1 = get_object_or_404(ExtraInfo, id=info[0], user=user_name) + student = get_object_or_404(Student, id=extra1) + + # Check if the user is already a member of the club + existing_club_member = Club_member.objects.filter( + club=user[1], member=student + ).first() + + if existing_club_member: + # If the user is already a member, update the existing entry and delete past entry + existing_club_member.status = "confirmed" + existing_club_member.remarks = remarks[0] + existing_club_member.save() + + # Delete past entries + Club_member.objects.filter(club=user[1], member=student).exclude( + id=existing_club_member.id + ).delete() + + else: + # If the user is not already a member, create a new entry + new_club_member = Club_member.objects.create( + club=user[1], member=student, status="confirmed", remarks=remarks[0] + ) + new_club_member.save() + + messages.success(request, "Successfully Approved !!!") + + return redirect("/gymkhana/") - # getting queryset class objects - user_name = get_object_or_404(User, username=info[1]) - extra1 = get_object_or_404(ExtraInfo, id=info[0], user=user_name) - student = get_object_or_404(Student, id=extra1) - - club_member = get_object_or_404(Club_member, club=user[1], member=student) - club_member.status = "confirmed" - club_member.remarks = remarks[0] - club_member.save() - messages.success(request, "Successfully Approved !!!") - - return redirect('/gymkhana/') @login_required def club_approve(request): @@ -1450,7 +1461,7 @@ def date_events(request): return HttpResponse(dates) return HttpResponse("Hurray") -#this algorithm checks if the passed slot time coflicts with any of already booked sessions +# this algorithm checks if the passed slot time coflicts with any of already booked sessions def conflict_algorithm_session(date, start_time, end_time, venue): #converting string to datetime type variable """ @@ -1628,7 +1639,7 @@ def delete_poll(request, poll_id): return redirect('/gymkhana/') -#this algorithm checks if the passed slot time coflicts with any of already booked events +# this algorithm checks if the passed slot time coflicts with any of already booked events def conflict_algorithm_event(date, start_time, end_time, venue): """ @@ -1654,7 +1665,7 @@ def conflict_algorithm_event(date, start_time, end_time, venue): #placing start time and end time in tuple fashion inside this list slots = [(start_time, end_time)] for value in booked_Events: - slots.append((value.start_time, value.end_time)) + slots.append((value.start_time, value.end_time)) slots.sort() #if there isn't any slot present for the selected day just book the event if (len(slots) == 1): @@ -1719,8 +1730,6 @@ def filetracking(request): ) if 'send' in request.POST: - - uploader = request.user.extrainfo logger.info(uploader) #ref_id = request.POST.get('fileid') @@ -1740,14 +1749,10 @@ def filetracking(request): designation=designation, upload_file=upload_file ) - - current_id = request.user.extrainfo remarks = request.POST.get('remarks') - sender = request.POST.get('design') current_design = HoldsDesignation.objects.select_related('user','working','designation').get(id=sender) - receiver = request.POST.get('receiver') receiver_id = User.objects.get(username=receiver) logger.info("Receiver_id = ") @@ -1772,13 +1777,10 @@ def filetracking(request): ) office_module_notif(request.user, receiver_id) messages.success(request,'File sent successfully') - except IntegrityError: message = "FileID Already Taken.!!" return HttpResponse(message) - - file = File.objects.select_related('uploader','uploader__user','uploader__department','designation').all() extrainfo = ExtraInfo.objects.select_related('user','department').all() holdsdesignations = HoldsDesignation.objects.select_related('user','working','designation').all() @@ -1869,6 +1871,3 @@ def forward(request, id): } return render(request, 'filetracking/forward.html', context) - - - diff --git a/FusionIIIT/applications/iwdModuleV2/urls.py b/FusionIIIT/applications/iwdModuleV2/urls.py index 6ad401098..c3ab9169a 100644 --- a/FusionIIIT/applications/iwdModuleV2/urls.py +++ b/FusionIIIT/applications/iwdModuleV2/urls.py @@ -5,8 +5,6 @@ app_name = 'iwdModuleV2' urlpatterns = [ - - url(r'^$', views.dashboard, name='IWD Dashboard'), url(r'^page1_1/$', views.page1_1, name='IWD Page1.1'), url(r'page2_1/$', views.page2_1, name='IWD Page2.1'), diff --git a/FusionIIIT/applications/programme_curriculum/migrations/0002_auto_20240115_1651.py b/FusionIIIT/applications/programme_curriculum/migrations/0002_auto_20240115_1651.py new file mode 100644 index 000000000..316444b58 --- /dev/null +++ b/FusionIIIT/applications/programme_curriculum/migrations/0002_auto_20240115_1651.py @@ -0,0 +1,23 @@ +# Generated by Django 3.1.5 on 2024-01-15 16:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('programme_curriculum', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='batch', + name='year', + field=models.PositiveIntegerField(default=2024), + ), + migrations.AlterField( + model_name='programme', + name='programme_begin_year', + field=models.PositiveIntegerField(default=2024), + ), + ] diff --git a/FusionIIIT/applications/scholarships/migrations/0002_auto_20240115_1651.py b/FusionIIIT/applications/scholarships/migrations/0002_auto_20240115_1651.py new file mode 100644 index 000000000..be534c660 --- /dev/null +++ b/FusionIIIT/applications/scholarships/migrations/0002_auto_20240115_1651.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.5 on 2024-01-15 16:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('scholarships', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='previous_winner', + name='year', + field=models.IntegerField(default=2024), + ), + ] diff --git a/FusionIIIT/templates/gymkhanaModule/active_poll.html b/FusionIIIT/templates/gymkhanaModule/active_poll.html index 38868f58e..d5bee5b50 100644 --- a/FusionIIIT/templates/gymkhanaModule/active_poll.html +++ b/FusionIIIT/templates/gymkhanaModule/active_poll.html @@ -1,9 +1,9 @@ -{% load voters_tag %} {% block active_poll %} +{% block active_poll %}
- {% for poll in voting_polls %} {% validate request.user poll.groups as car%} - {% if car %} -
+ {% for poll in voting_polls %} {% comment %} {% if + request.user.groups.filter(name__in=poll.groups).exists %} {% endcomment %} +
-

- {{poll.title}} -

- - {% if poll.exp_date == 'expire' %} -

Expired

+

{{poll.title}}

+ {% if poll.exp_date > now %} +

Expired

{% else %} -

Expires in: {{poll.exp_date}} Days

+

Expires in: {{poll.exp_date}} Days

{% endif %}
-
- {% csrf_token %} {% if poll.exp_date == 'expire' %} + {% csrf_token %} {% if poll.exp_date > now %}

Results

-

{{poll.max}}

+

{{poll.max}}

{% else %} {% for choice in poll.choices %}
{{choice.title}}
@@ -66,7 +62,6 @@
{% endfor %} {% endif %} -
@@ -74,7 +69,7 @@ - {% elif roll in poll.voters %} + {% elif request.user in poll.voters %} @@ -83,7 +78,7 @@ {% endif %}
-

+

Created By: {{poll.created_by.0}}, {{poll.created_by.1}}

@@ -92,7 +87,7 @@
- {% endif %} {% endfor %} + {% comment %} {% endif %} {% endcomment %} {% endfor %}
- {% endblock active_poll %} diff --git a/FusionIIIT/templates/gymkhanaModule/create_poll.html b/FusionIIIT/templates/gymkhanaModule/create_poll.html index 81e2c8f9f..f306940d7 100644 --- a/FusionIIIT/templates/gymkhanaModule/create_poll.html +++ b/FusionIIIT/templates/gymkhanaModule/create_poll.html @@ -19,28 +19,28 @@

Poll Information

@@ -52,7 +52,7 @@

Poll Information

Choices

@@ -60,14 +60,14 @@

Choices