diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..6a87348 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +asgiref==3.7.2 +Django==4.2.11 +mysqlclient==2.2.4 +pillow==10.2.0 +sqlparse==0.4.4 +typing_extensions==4.10.0 +tzdata==2024.1 diff --git a/skyonnweb/007.docx b/skyonnweb/007.docx new file mode 100644 index 0000000..3333194 Binary files /dev/null and b/skyonnweb/007.docx differ diff --git a/skyonnweb/manage.py b/skyonnweb/manage.py new file mode 100644 index 0000000..8c91b94 --- /dev/null +++ b/skyonnweb/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'skyonnweb.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/skyonnweb/media/007.docx b/skyonnweb/media/007.docx new file mode 100644 index 0000000..52dd860 Binary files /dev/null and b/skyonnweb/media/007.docx differ diff --git a/skyonnweb/media/100001.pdf b/skyonnweb/media/100001.pdf new file mode 100644 index 0000000..2c4f9f2 Binary files /dev/null and b/skyonnweb/media/100001.pdf differ diff --git a/skyonnweb/media/1001.docx b/skyonnweb/media/1001.docx new file mode 100644 index 0000000..dbf3ffc Binary files /dev/null and b/skyonnweb/media/1001.docx differ diff --git a/skyonnweb/media/1001_1vmm3qO.docx b/skyonnweb/media/1001_1vmm3qO.docx new file mode 100644 index 0000000..dbf3ffc Binary files /dev/null and b/skyonnweb/media/1001_1vmm3qO.docx differ diff --git a/skyonnweb/media/1001_FZ56zrZ.docx b/skyonnweb/media/1001_FZ56zrZ.docx new file mode 100644 index 0000000..dbf3ffc Binary files /dev/null and b/skyonnweb/media/1001_FZ56zrZ.docx differ diff --git a/skyonnweb/media/1001_k2oz1xX.docx b/skyonnweb/media/1001_k2oz1xX.docx new file mode 100644 index 0000000..dbf3ffc Binary files /dev/null and b/skyonnweb/media/1001_k2oz1xX.docx differ diff --git a/skyonnweb/media/1010.pdf b/skyonnweb/media/1010.pdf new file mode 100644 index 0000000..955e36c Binary files /dev/null and b/skyonnweb/media/1010.pdf differ diff --git a/skyonnweb/media/1111.docx b/skyonnweb/media/1111.docx new file mode 100644 index 0000000..74069fd Binary files /dev/null and b/skyonnweb/media/1111.docx differ diff --git a/skyonnweb/media/1111.pdf b/skyonnweb/media/1111.pdf new file mode 100644 index 0000000..7a78ff4 Binary files /dev/null and b/skyonnweb/media/1111.pdf differ diff --git a/skyonnweb/media/11112.docx b/skyonnweb/media/11112.docx new file mode 100644 index 0000000..3333194 Binary files /dev/null and b/skyonnweb/media/11112.docx differ diff --git a/skyonnweb/media/1122.docx b/skyonnweb/media/1122.docx new file mode 100644 index 0000000..74069fd Binary files /dev/null and b/skyonnweb/media/1122.docx differ diff --git a/skyonnweb/media/122.docx b/skyonnweb/media/122.docx new file mode 100644 index 0000000..3333194 Binary files /dev/null and b/skyonnweb/media/122.docx differ diff --git a/skyonnweb/media/122000.docx b/skyonnweb/media/122000.docx new file mode 100644 index 0000000..3333194 Binary files /dev/null and b/skyonnweb/media/122000.docx differ diff --git a/skyonnweb/media/1234.docx b/skyonnweb/media/1234.docx new file mode 100644 index 0000000..52dd860 Binary files /dev/null and b/skyonnweb/media/1234.docx differ diff --git a/skyonnweb/media/1234.pdf b/skyonnweb/media/1234.pdf new file mode 100644 index 0000000..5cfadb9 Binary files /dev/null and b/skyonnweb/media/1234.pdf differ diff --git a/skyonnweb/media/12345.docx b/skyonnweb/media/12345.docx new file mode 100644 index 0000000..52dd860 Binary files /dev/null and b/skyonnweb/media/12345.docx differ diff --git a/skyonnweb/media/1234_YMaBUYe.pdf b/skyonnweb/media/1234_YMaBUYe.pdf new file mode 100644 index 0000000..7a78ff4 Binary files /dev/null and b/skyonnweb/media/1234_YMaBUYe.pdf differ diff --git a/skyonnweb/media/1234_qNVO1jG.pdf b/skyonnweb/media/1234_qNVO1jG.pdf new file mode 100644 index 0000000..5cfadb9 Binary files /dev/null and b/skyonnweb/media/1234_qNVO1jG.pdf differ diff --git a/skyonnweb/media/12w.docx b/skyonnweb/media/12w.docx new file mode 100644 index 0000000..3333194 Binary files /dev/null and b/skyonnweb/media/12w.docx differ diff --git a/skyonnweb/media/144.docx b/skyonnweb/media/144.docx new file mode 100644 index 0000000..d11c3a0 Binary files /dev/null and b/skyonnweb/media/144.docx differ diff --git a/skyonnweb/media/2000.docx b/skyonnweb/media/2000.docx new file mode 100644 index 0000000..dbf3ffc Binary files /dev/null and b/skyonnweb/media/2000.docx differ diff --git a/skyonnweb/media/200004.docx b/skyonnweb/media/200004.docx new file mode 100644 index 0000000..3333194 Binary files /dev/null and b/skyonnweb/media/200004.docx differ diff --git a/skyonnweb/media/20003.pdf b/skyonnweb/media/20003.pdf new file mode 100644 index 0000000..955e36c Binary files /dev/null and b/skyonnweb/media/20003.pdf differ diff --git a/skyonnweb/media/2001.docx b/skyonnweb/media/2001.docx new file mode 100644 index 0000000..dbf3ffc Binary files /dev/null and b/skyonnweb/media/2001.docx differ diff --git a/skyonnweb/media/2222.pdf b/skyonnweb/media/2222.pdf new file mode 100644 index 0000000..7a78ff4 Binary files /dev/null and b/skyonnweb/media/2222.pdf differ diff --git a/skyonnweb/media/22222.pdf b/skyonnweb/media/22222.pdf new file mode 100644 index 0000000..0f8b088 Binary files /dev/null and b/skyonnweb/media/22222.pdf differ diff --git a/skyonnweb/media/2WWWW.docx b/skyonnweb/media/2WWWW.docx new file mode 100644 index 0000000..52dd860 Binary files /dev/null and b/skyonnweb/media/2WWWW.docx differ diff --git a/skyonnweb/media/2WWWW_ryfaDVl.docx b/skyonnweb/media/2WWWW_ryfaDVl.docx new file mode 100644 index 0000000..dbf3ffc Binary files /dev/null and b/skyonnweb/media/2WWWW_ryfaDVl.docx differ diff --git a/skyonnweb/media/3000.docx b/skyonnweb/media/3000.docx new file mode 100644 index 0000000..dbf3ffc Binary files /dev/null and b/skyonnweb/media/3000.docx differ diff --git a/skyonnweb/media/3000.pdf b/skyonnweb/media/3000.pdf new file mode 100644 index 0000000..2c4f9f2 Binary files /dev/null and b/skyonnweb/media/3000.pdf differ diff --git a/skyonnweb/media/350.docx b/skyonnweb/media/350.docx new file mode 100644 index 0000000..d11c3a0 Binary files /dev/null and b/skyonnweb/media/350.docx differ diff --git a/skyonnweb/media/4000.pdf b/skyonnweb/media/4000.pdf new file mode 100644 index 0000000..2c4f9f2 Binary files /dev/null and b/skyonnweb/media/4000.pdf differ diff --git a/skyonnweb/media/40000.docx b/skyonnweb/media/40000.docx new file mode 100644 index 0000000..3333194 Binary files /dev/null and b/skyonnweb/media/40000.docx differ diff --git a/skyonnweb/media/4567.docx b/skyonnweb/media/4567.docx new file mode 100644 index 0000000..74069fd Binary files /dev/null and b/skyonnweb/media/4567.docx differ diff --git a/skyonnweb/media/4567.pdf b/skyonnweb/media/4567.pdf new file mode 100644 index 0000000..5cfadb9 Binary files /dev/null and b/skyonnweb/media/4567.pdf differ diff --git a/skyonnweb/media/5000.docx b/skyonnweb/media/5000.docx new file mode 100644 index 0000000..3333194 Binary files /dev/null and b/skyonnweb/media/5000.docx differ diff --git a/skyonnweb/media/7000.docx b/skyonnweb/media/7000.docx new file mode 100644 index 0000000..74069fd Binary files /dev/null and b/skyonnweb/media/7000.docx differ diff --git a/skyonnweb/media/786.docx b/skyonnweb/media/786.docx new file mode 100644 index 0000000..d11c3a0 Binary files /dev/null and b/skyonnweb/media/786.docx differ diff --git a/skyonnweb/media/9876.pdf b/skyonnweb/media/9876.pdf new file mode 100644 index 0000000..5cfadb9 Binary files /dev/null and b/skyonnweb/media/9876.pdf differ diff --git a/skyonnweb/media/9876_uWKMpAx.pdf b/skyonnweb/media/9876_uWKMpAx.pdf new file mode 100644 index 0000000..7a78ff4 Binary files /dev/null and b/skyonnweb/media/9876_uWKMpAx.pdf differ diff --git a/skyonnweb/media/CGEMPJP00233848.docx b/skyonnweb/media/CGEMPJP00233848.docx new file mode 100644 index 0000000..d11c3a0 Binary files /dev/null and b/skyonnweb/media/CGEMPJP00233848.docx differ diff --git a/skyonnweb/media/JI7865.docx b/skyonnweb/media/JI7865.docx new file mode 100644 index 0000000..d11c3a0 Binary files /dev/null and b/skyonnweb/media/JI7865.docx differ diff --git a/skyonnweb/media/ORN1234567.pdf b/skyonnweb/media/ORN1234567.pdf new file mode 100644 index 0000000..2c4f9f2 Binary files /dev/null and b/skyonnweb/media/ORN1234567.pdf differ diff --git a/skyonnweb/media/a.docx b/skyonnweb/media/a.docx new file mode 100644 index 0000000..dbf3ffc Binary files /dev/null and b/skyonnweb/media/a.docx differ diff --git a/skyonnweb/media/a_6p6oUgN.docx b/skyonnweb/media/a_6p6oUgN.docx new file mode 100644 index 0000000..52dd860 Binary files /dev/null and b/skyonnweb/media/a_6p6oUgN.docx differ diff --git a/skyonnweb/media/hjuu89.docx b/skyonnweb/media/hjuu89.docx new file mode 100644 index 0000000..dbf3ffc Binary files /dev/null and b/skyonnweb/media/hjuu89.docx differ diff --git a/skyonnweb/media/laxmi1223.pdf b/skyonnweb/media/laxmi1223.pdf new file mode 100644 index 0000000..2c4f9f2 Binary files /dev/null and b/skyonnweb/media/laxmi1223.pdf differ diff --git a/skyonnweb/media/laxmi1223_YQdQ5xn.pdf b/skyonnweb/media/laxmi1223_YQdQ5xn.pdf new file mode 100644 index 0000000..2c4f9f2 Binary files /dev/null and b/skyonnweb/media/laxmi1223_YQdQ5xn.pdf differ diff --git a/skyonnweb/media/laxmi89.pdf b/skyonnweb/media/laxmi89.pdf new file mode 100644 index 0000000..9f98083 Binary files /dev/null and b/skyonnweb/media/laxmi89.pdf differ diff --git a/skyonnweb/media/laxni87.pdf b/skyonnweb/media/laxni87.pdf new file mode 100644 index 0000000..9f98083 Binary files /dev/null and b/skyonnweb/media/laxni87.pdf differ diff --git a/skyonnweb/media/profile_pics/5.jpg b/skyonnweb/media/profile_pics/5.jpg new file mode 100644 index 0000000..3743e6c Binary files /dev/null and b/skyonnweb/media/profile_pics/5.jpg differ diff --git a/skyonnweb/media/profile_pics/images.html b/skyonnweb/media/profile_pics/images.html new file mode 100644 index 0000000..a14fda3 --- /dev/null +++ b/skyonnweb/media/profile_pics/images.html @@ -0,0 +1,7 @@ + + +
+ +
+ + diff --git a/skyonnweb/media/profile_pics/images_TZObiZb.html b/skyonnweb/media/profile_pics/images_TZObiZb.html new file mode 100644 index 0000000..a14fda3 --- /dev/null +++ b/skyonnweb/media/profile_pics/images_TZObiZb.html @@ -0,0 +1,7 @@ + + +
+ +
+ + diff --git a/skyonnweb/media/profile_pics/laxmi2.jpg b/skyonnweb/media/profile_pics/laxmi2.jpg new file mode 100644 index 0000000..bcf8f94 Binary files /dev/null and b/skyonnweb/media/profile_pics/laxmi2.jpg differ diff --git a/skyonnweb/media/profile_pics/laxmi4.jpg b/skyonnweb/media/profile_pics/laxmi4.jpg new file mode 100644 index 0000000..5750dcb Binary files /dev/null and b/skyonnweb/media/profile_pics/laxmi4.jpg differ diff --git a/skyonnweb/media/profile_pics/laxmi4_DVzJEX7.jpg b/skyonnweb/media/profile_pics/laxmi4_DVzJEX7.jpg new file mode 100644 index 0000000..5750dcb Binary files /dev/null and b/skyonnweb/media/profile_pics/laxmi4_DVzJEX7.jpg differ diff --git a/skyonnweb/media/profile_pics/laxmi6.jpg b/skyonnweb/media/profile_pics/laxmi6.jpg new file mode 100644 index 0000000..1523635 Binary files /dev/null and b/skyonnweb/media/profile_pics/laxmi6.jpg differ diff --git a/skyonnweb/media/profile_pics/motion-sensor_11256354.png b/skyonnweb/media/profile_pics/motion-sensor_11256354.png new file mode 100644 index 0000000..f377ad5 Binary files /dev/null and b/skyonnweb/media/profile_pics/motion-sensor_11256354.png differ diff --git a/skyonnweb/media/tcslucky234.docx b/skyonnweb/media/tcslucky234.docx new file mode 100644 index 0000000..3333194 Binary files /dev/null and b/skyonnweb/media/tcslucky234.docx differ diff --git a/skyonnweb/profile_pics/download_1.htm b/skyonnweb/profile_pics/download_1.htm new file mode 100644 index 0000000..56baa95 --- /dev/null +++ b/skyonnweb/profile_pics/download_1.htm @@ -0,0 +1,1540 @@ + + + + + + + + + + + Admin Dashboard + + +
+

Home

+

Admin Dashboard

+
+ +
+
+ +
+
+ +
+

Laxmi

+LogOut +
+
+ + + +
+ + + +
+ + + + \ No newline at end of file diff --git a/skyonnweb/skyonnadmin/__init__.py b/skyonnweb/skyonnadmin/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/skyonnweb/skyonnadmin/admin.py b/skyonnweb/skyonnadmin/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/skyonnweb/skyonnadmin/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/skyonnweb/skyonnadmin/apps.py b/skyonnweb/skyonnadmin/apps.py new file mode 100644 index 0000000..24690bd --- /dev/null +++ b/skyonnweb/skyonnadmin/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class SkyonnadminConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'skyonnadmin' diff --git a/skyonnweb/skyonnadmin/migrations/0001_initial.py b/skyonnweb/skyonnadmin/migrations/0001_initial.py new file mode 100644 index 0000000..f0e7430 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0001_initial.py @@ -0,0 +1,84 @@ +# Generated by Django 4.2.11 on 2024-05-07 11:06 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Contact', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('client_id', models.CharField(max_length=30, null=True)), + ('name', models.CharField(max_length=40, null=True)), + ('designation', models.CharField(max_length=50, null=True)), + ('department', models.CharField(max_length=50, null=True)), + ('phone_no', models.CharField(max_length=50, null=True)), + ('email', models.EmailField(max_length=254, null=True)), + ('location', models.CharField(max_length=102, null=True)), + ], + ), + migrations.CreateModel( + name='Locations', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('location', models.CharField(max_length=50, null=True)), + ], + ), + migrations.CreateModel( + name='skyonnAdmin', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('password', models.CharField(max_length=128, verbose_name='password')), + ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), + ('first_name', models.CharField(max_length=50)), + ('last_name', models.CharField(max_length=50)), + ('phone', models.CharField(max_length=15, unique=True)), + ('phone_number_2', models.CharField(blank=True, max_length=15, null=True)), + ('company_email', models.EmailField(max_length=254, null=True)), + ('personal_email', models.EmailField(max_length=254, null=True)), + ('address', models.TextField(null=True)), + ('work_location', models.CharField(max_length=100, null=True)), + ('picture', models.ImageField(null=True, upload_to='profile_pics/')), + ('role', models.CharField(max_length=20)), + ('admin_id', models.CharField(max_length=10, unique=True)), + ('is_active', models.BooleanField(default=True)), + ('is_staff', models.BooleanField(default=False)), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='SubcompanyDetails', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('parent_company', models.CharField(max_length=100)), + ('sub_company', models.CharField(max_length=100, unique=True)), + ('location', models.CharField(max_length=100)), + ('gst_no', models.CharField(max_length=50)), + ('address', models.CharField(max_length=200)), + ('client_id', models.CharField(max_length=20, null=True)), + ('contacts', models.ManyToManyField(related_name='subcompany_contacts', to='skyonnadmin.contact')), + ], + ), + migrations.CreateModel( + name='ClientDetails', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('parent_company', models.CharField(max_length=100)), + ('location', models.CharField(max_length=100)), + ('department', models.CharField(max_length=100)), + ('gst_no', models.CharField(max_length=50)), + ('address', models.CharField(max_length=200)), + ('client_id', models.CharField(max_length=20, null=True)), + ('contacts', models.ManyToManyField(related_name='contacts', to='skyonnadmin.contact')), + ], + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0002_addcontact_rename_phone_no_contact_first_name_and_more.py b/skyonnweb/skyonnadmin/migrations/0002_addcontact_rename_phone_no_contact_first_name_and_more.py new file mode 100644 index 0000000..45be9e2 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0002_addcontact_rename_phone_no_contact_first_name_and_more.py @@ -0,0 +1,141 @@ +# Generated by Django 5.0.6 on 2024-05-25 05:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='AddContact', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('Company', models.CharField(max_length=100, null=True)), + ('Sub_company', models.CharField(max_length=100, null=True)), + ('location', models.CharField(max_length=50, null=True)), + ('Department', models.CharField(max_length=50, null=True)), + ('Designation', models.CharField(max_length=50, null=True)), + ('Phone_number', models.IntegerField(null=True)), + ('Email', models.EmailField(max_length=254, null=True)), + ], + ), + migrations.RenameField( + model_name='contact', + old_name='phone_no', + new_name='first_name', + ), + migrations.RemoveField( + model_name='clientdetails', + name='contacts', + ), + migrations.RemoveField( + model_name='contact', + name='email', + ), + migrations.RemoveField( + model_name='contact', + name='location', + ), + migrations.RemoveField( + model_name='contact', + name='name', + ), + migrations.RemoveField( + model_name='subcompanydetails', + name='contacts', + ), + migrations.AddField( + model_name='contact', + name='company_email', + field=models.EmailField(default='default_company_email@example.com', max_length=254, null=True), + ), + migrations.AddField( + model_name='contact', + name='last_name', + field=models.CharField(max_length=50, null=True), + ), + migrations.AddField( + model_name='contact', + name='phone_no1', + field=models.CharField(max_length=20, null=True), + ), + migrations.AddField( + model_name='contact', + name='phone_no2', + field=models.CharField(blank=True, max_length=20, null=True), + ), + migrations.AddField( + model_name='subcompanydetails', + name='department', + field=models.CharField(max_length=100, null=True), + ), + migrations.AlterField( + model_name='clientdetails', + name='address', + field=models.CharField(max_length=200, null=True), + ), + migrations.AlterField( + model_name='clientdetails', + name='department', + field=models.CharField(max_length=100, null=True), + ), + migrations.AlterField( + model_name='clientdetails', + name='gst_no', + field=models.CharField(max_length=50, null=True), + ), + migrations.AlterField( + model_name='clientdetails', + name='location', + field=models.CharField(max_length=100, null=True), + ), + migrations.AlterField( + model_name='clientdetails', + name='parent_company', + field=models.CharField(max_length=100, null=True), + ), + migrations.AlterField( + model_name='contact', + name='client_id', + field=models.CharField(max_length=20, null=True), + ), + migrations.AlterField( + model_name='contact', + name='department', + field=models.CharField(max_length=100, null=True), + ), + migrations.AlterField( + model_name='contact', + name='designation', + field=models.CharField(max_length=100, null=True), + ), + migrations.AlterField( + model_name='subcompanydetails', + name='address', + field=models.CharField(max_length=200, null=True), + ), + migrations.AlterField( + model_name='subcompanydetails', + name='gst_no', + field=models.CharField(max_length=50, null=True), + ), + migrations.AlterField( + model_name='subcompanydetails', + name='location', + field=models.CharField(max_length=100, null=True), + ), + migrations.AlterField( + model_name='subcompanydetails', + name='parent_company', + field=models.CharField(max_length=100, null=True), + ), + migrations.AlterField( + model_name='subcompanydetails', + name='sub_company', + field=models.CharField(max_length=100, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0003_rename_address_clientdetails_street_and_more.py b/skyonnweb/skyonnadmin/migrations/0003_rename_address_clientdetails_street_and_more.py new file mode 100644 index 0000000..9bcbdde --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0003_rename_address_clientdetails_street_and_more.py @@ -0,0 +1,161 @@ +# Generated by Django 5.0.6 on 2024-05-25 06:10 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0002_addcontact_rename_phone_no_contact_first_name_and_more'), + ] + + operations = [ + migrations.RenameField( + model_name='clientdetails', + old_name='address', + new_name='Street', + ), + migrations.RenameField( + model_name='clientdetails', + old_name='department', + new_name='location_Id', + ), + migrations.RenameField( + model_name='contact', + old_name='first_name', + new_name='phone_no', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='address', + new_name='State', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='department', + new_name='location_id', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='client_id', + new_name='sub_client_id', + ), + migrations.RemoveField( + model_name='clientdetails', + name='location', + ), + migrations.RemoveField( + model_name='contact', + name='client_id', + ), + migrations.RemoveField( + model_name='contact', + name='company_email', + ), + migrations.RemoveField( + model_name='contact', + name='last_name', + ), + migrations.RemoveField( + model_name='contact', + name='phone_no1', + ), + migrations.RemoveField( + model_name='contact', + name='phone_no2', + ), + migrations.RemoveField( + model_name='subcompanydetails', + name='location', + ), + migrations.AddField( + model_name='clientdetails', + name='Pincode', + field=models.IntegerField(max_length=200, null=True), + ), + migrations.AddField( + model_name='clientdetails', + name='address_1', + field=models.CharField(blank=True, max_length=300, null=True), + ), + migrations.AddField( + model_name='clientdetails', + name='address_2', + field=models.CharField(blank=True, max_length=200, null=True), + ), + migrations.AddField( + model_name='clientdetails', + name='contacts', + field=models.ManyToManyField(related_name='contacts', to='skyonnadmin.contact'), + ), + migrations.AddField( + model_name='clientdetails', + name='country', + field=models.CharField(max_length=200, null=True), + ), + migrations.AddField( + model_name='clientdetails', + name='state', + field=models.CharField(blank=True, max_length=300, null=True), + ), + migrations.AddField( + model_name='contact', + name='email', + field=models.EmailField(max_length=254, null=True), + ), + migrations.AddField( + model_name='contact', + name='location', + field=models.CharField(max_length=102, null=True), + ), + migrations.AddField( + model_name='contact', + name='name', + field=models.CharField(max_length=40, null=True), + ), + migrations.AddField( + model_name='subcompanydetails', + name='Pincode', + field=models.IntegerField(max_length=200, null=True), + ), + migrations.AddField( + model_name='subcompanydetails', + name='Street', + field=models.CharField(max_length=200, null=True), + ), + migrations.AddField( + model_name='subcompanydetails', + name='address_1', + field=models.CharField(max_length=200, null=True), + ), + migrations.AddField( + model_name='subcompanydetails', + name='address_2', + field=models.CharField(max_length=200, null=True), + ), + migrations.AddField( + model_name='subcompanydetails', + name='country', + field=models.CharField(max_length=200, null=True), + ), + migrations.AlterField( + model_name='addcontact', + name='Phone_number', + field=models.IntegerField(max_length=50, null=True), + ), + migrations.AlterField( + model_name='contact', + name='department', + field=models.CharField(max_length=50, null=True), + ), + migrations.AlterField( + model_name='contact', + name='designation', + field=models.CharField(max_length=50, null=True), + ), + migrations.AlterField( + model_name='subcompanydetails', + name='sub_company', + field=models.CharField(max_length=100, null=True, unique=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0004_remove_clientdetails_street_and_more.py b/skyonnweb/skyonnadmin/migrations/0004_remove_clientdetails_street_and_more.py new file mode 100644 index 0000000..7b8e971 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0004_remove_clientdetails_street_and_more.py @@ -0,0 +1,21 @@ +# Generated by Django 5.0.6 on 2024-05-27 06:10 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0003_rename_address_clientdetails_street_and_more'), + ] + + operations = [ + migrations.RemoveField( + model_name='clientdetails', + name='Street', + ), + migrations.RemoveField( + model_name='subcompanydetails', + name='Street', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0005_subcompanydetails_city.py b/skyonnweb/skyonnadmin/migrations/0005_subcompanydetails_city.py new file mode 100644 index 0000000..8420403 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0005_subcompanydetails_city.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.6 on 2024-05-27 06:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0004_remove_clientdetails_street_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='subcompanydetails', + name='City', + field=models.CharField(max_length=200, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0006_clientdetails_city.py b/skyonnweb/skyonnadmin/migrations/0006_clientdetails_city.py new file mode 100644 index 0000000..aa9da8f --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0006_clientdetails_city.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.6 on 2024-05-27 07:35 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0005_subcompanydetails_city'), + ] + + operations = [ + migrations.AddField( + model_name='clientdetails', + name='City', + field=models.CharField(max_length=200, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0007_alter_clientdetails_parent_company.py b/skyonnweb/skyonnadmin/migrations/0007_alter_clientdetails_parent_company.py new file mode 100644 index 0000000..028e68c --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0007_alter_clientdetails_parent_company.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.6 on 2024-05-27 07:38 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0006_clientdetails_city'), + ] + + operations = [ + migrations.AlterField( + model_name='clientdetails', + name='parent_company', + field=models.CharField(max_length=100, null=True, unique=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0008_alter_addcontact_phone_number.py b/skyonnweb/skyonnadmin/migrations/0008_alter_addcontact_phone_number.py new file mode 100644 index 0000000..cc2ec09 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0008_alter_addcontact_phone_number.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.6 on 2024-05-28 08:17 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0007_alter_clientdetails_parent_company'), + ] + + operations = [ + migrations.AlterField( + model_name='addcontact', + name='Phone_number', + field=models.IntegerField(null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0009_alter_addcontact_phone_number_and_more.py b/skyonnweb/skyonnadmin/migrations/0009_alter_addcontact_phone_number_and_more.py new file mode 100644 index 0000000..49b1188 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0009_alter_addcontact_phone_number_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 5.0.6 on 2024-05-28 08:23 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0008_alter_addcontact_phone_number'), + ] + + operations = [ + migrations.AlterField( + model_name='addcontact', + name='Phone_number', + field=models.CharField(max_length=10, null=True), + ), + migrations.AlterField( + model_name='clientdetails', + name='Pincode', + field=models.IntegerField(null=True), + ), + migrations.AlterField( + model_name='subcompanydetails', + name='Pincode', + field=models.IntegerField(null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0010_addcontact_name.py b/skyonnweb/skyonnadmin/migrations/0010_addcontact_name.py new file mode 100644 index 0000000..3f48e31 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0010_addcontact_name.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.6 on 2024-06-04 09:06 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0009_alter_addcontact_phone_number_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='addcontact', + name='Name', + field=models.CharField(max_length=100, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0011_rename_address_1_subcompanydetails_address_1_and_more.py b/skyonnweb/skyonnadmin/migrations/0011_rename_address_1_subcompanydetails_address_1_and_more.py new file mode 100644 index 0000000..5b05329 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0011_rename_address_1_subcompanydetails_address_1_and_more.py @@ -0,0 +1,53 @@ +# Generated by Django 5.0.6 on 2024-06-07 06:34 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0010_addcontact_name'), + ] + + operations = [ + migrations.RenameField( + model_name='subcompanydetails', + old_name='address_1', + new_name='Address_1', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='address_2', + new_name='Address_2', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='country', + new_name='Country', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='gst_no', + new_name='GST_no', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='location_id', + new_name='Location_id', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='parent_company', + new_name='Parent_company', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='sub_client_id', + new_name='Sub_client_id', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='sub_company', + new_name='Sub_company', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0012_rename_address_1_clientdetails_address_1_and_more.py b/skyonnweb/skyonnadmin/migrations/0012_rename_address_1_clientdetails_address_1_and_more.py new file mode 100644 index 0000000..b858fe7 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0012_rename_address_1_clientdetails_address_1_and_more.py @@ -0,0 +1,48 @@ +# Generated by Django 5.0.6 on 2024-06-07 06:50 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0011_rename_address_1_subcompanydetails_address_1_and_more'), + ] + + operations = [ + migrations.RenameField( + model_name='clientdetails', + old_name='address_1', + new_name='Address_1', + ), + migrations.RenameField( + model_name='clientdetails', + old_name='address_2', + new_name='Address_2', + ), + migrations.RenameField( + model_name='clientdetails', + old_name='country', + new_name='Country', + ), + migrations.RenameField( + model_name='clientdetails', + old_name='gst_no', + new_name='GST_no', + ), + migrations.RenameField( + model_name='clientdetails', + old_name='location_Id', + new_name='Location_Id', + ), + migrations.RenameField( + model_name='clientdetails', + old_name='parent_company', + new_name='Parent_company', + ), + migrations.RenameField( + model_name='clientdetails', + old_name='state', + new_name='State', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0013_rename_address_1_clientdetails_address_1_and_more.py b/skyonnweb/skyonnadmin/migrations/0013_rename_address_1_clientdetails_address_1_and_more.py new file mode 100644 index 0000000..4479616 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0013_rename_address_1_clientdetails_address_1_and_more.py @@ -0,0 +1,88 @@ +# Generated by Django 5.0.6 on 2024-06-07 07:08 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0012_rename_address_1_clientdetails_address_1_and_more'), + ] + + operations = [ + migrations.RenameField( + model_name='clientdetails', + old_name='Address_1', + new_name='address_1', + ), + migrations.RenameField( + model_name='clientdetails', + old_name='Address_2', + new_name='address_2', + ), + migrations.RenameField( + model_name='clientdetails', + old_name='Country', + new_name='country', + ), + migrations.RenameField( + model_name='clientdetails', + old_name='GST_no', + new_name='gst_no', + ), + migrations.RenameField( + model_name='clientdetails', + old_name='Location_Id', + new_name='location_Id', + ), + migrations.RenameField( + model_name='clientdetails', + old_name='Parent_company', + new_name='parent_company', + ), + migrations.RenameField( + model_name='clientdetails', + old_name='State', + new_name='state', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='Address_1', + new_name='address_1', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='Address_2', + new_name='address_2', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='Country', + new_name='country', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='GST_no', + new_name='gst_no', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='Location_id', + new_name='location_id', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='Parent_company', + new_name='parent_company', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='Sub_client_id', + new_name='sub_client_id', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='Sub_company', + new_name='sub_company', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0014_sublocationdetails_alter_addcontact_company_and_more.py b/skyonnweb/skyonnadmin/migrations/0014_sublocationdetails_alter_addcontact_company_and_more.py new file mode 100644 index 0000000..820f86e --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0014_sublocationdetails_alter_addcontact_company_and_more.py @@ -0,0 +1,69 @@ +# Generated by Django 5.0.6 on 2024-06-10 07:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0013_rename_address_1_clientdetails_address_1_and_more'), + ] + + operations = [ + migrations.CreateModel( + name='SublocationDetails', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('parent_company', models.CharField(max_length=100, null=True)), + ('department', models.CharField(max_length=100, null=True)), + ('Location', models.CharField(max_length=100, null=True)), + ('gst_no', models.CharField(max_length=50, null=True)), + ('address_1', models.CharField(blank=True, max_length=300, null=True)), + ('address_2', models.CharField(blank=True, max_length=200, null=True)), + ('City', models.CharField(max_length=200, null=True)), + ('state', models.CharField(blank=True, max_length=300, null=True)), + ('Pincode', models.IntegerField(null=True)), + ('country', models.CharField(max_length=200, null=True)), + ], + ), + migrations.AlterField( + model_name='addcontact', + name='Company', + field=models.CharField(blank=True, max_length=100, null=True), + ), + migrations.AlterField( + model_name='addcontact', + name='Department', + field=models.CharField(blank=True, max_length=50, null=True), + ), + migrations.AlterField( + model_name='addcontact', + name='Designation', + field=models.CharField(blank=True, max_length=50, null=True), + ), + migrations.AlterField( + model_name='addcontact', + name='Email', + field=models.EmailField(max_length=254, null=True, unique=True), + ), + migrations.AlterField( + model_name='addcontact', + name='Name', + field=models.CharField(max_length=100, null=True, unique=True), + ), + migrations.AlterField( + model_name='addcontact', + name='Phone_number', + field=models.CharField(max_length=10, null=True, unique=True), + ), + migrations.AlterField( + model_name='addcontact', + name='Sub_company', + field=models.CharField(blank=True, max_length=100, null=True), + ), + migrations.AlterField( + model_name='addcontact', + name='location', + field=models.CharField(blank=True, max_length=50, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0015_rename_state_sublocationdetails_state_and_more.py b/skyonnweb/skyonnadmin/migrations/0015_rename_state_sublocationdetails_state_and_more.py new file mode 100644 index 0000000..fe9d870 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0015_rename_state_sublocationdetails_state_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 5.0.6 on 2024-06-10 09:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0014_sublocationdetails_alter_addcontact_company_and_more'), + ] + + operations = [ + migrations.RenameField( + model_name='sublocationdetails', + old_name='state', + new_name='State', + ), + migrations.AlterField( + model_name='addcontact', + name='Name', + field=models.CharField(max_length=100, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0016_rename_gst_no_clientdetails_gst_no_and_more.py b/skyonnweb/skyonnadmin/migrations/0016_rename_gst_no_clientdetails_gst_no_and_more.py new file mode 100644 index 0000000..0da34d9 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0016_rename_gst_no_clientdetails_gst_no_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 5.0.6 on 2024-06-10 10:30 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0015_rename_state_sublocationdetails_state_and_more'), + ] + + operations = [ + migrations.RenameField( + model_name='clientdetails', + old_name='gst_no', + new_name='GST_No', + ), + migrations.RenameField( + model_name='subcompanydetails', + old_name='gst_no', + new_name='GST_No', + ), + migrations.RenameField( + model_name='sublocationdetails', + old_name='gst_no', + new_name='GST_No', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0017_alter_clientdetails_gst_no_and_more.py b/skyonnweb/skyonnadmin/migrations/0017_alter_clientdetails_gst_no_and_more.py new file mode 100644 index 0000000..31fd2dc --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0017_alter_clientdetails_gst_no_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 5.0.6 on 2024-06-12 10:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0016_rename_gst_no_clientdetails_gst_no_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='clientdetails', + name='GST_No', + field=models.CharField(max_length=50, null=True, unique=True), + ), + migrations.AlterField( + model_name='subcompanydetails', + name='GST_No', + field=models.CharField(max_length=50, null=True, unique=True), + ), + migrations.AlterField( + model_name='sublocationdetails', + name='GST_No', + field=models.CharField(max_length=50, null=True, unique=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0018_alter_clientdetails_gst_no.py b/skyonnweb/skyonnadmin/migrations/0018_alter_clientdetails_gst_no.py new file mode 100644 index 0000000..6efa24a --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0018_alter_clientdetails_gst_no.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.11 on 2024-06-23 11:53 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0017_alter_clientdetails_gst_no_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='clientdetails', + name='GST_No', + field=models.CharField(max_length=50, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0019_alter_subcompanydetails_gst_no_and_more.py b/skyonnweb/skyonnadmin/migrations/0019_alter_subcompanydetails_gst_no_and_more.py new file mode 100644 index 0000000..410c9b6 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0019_alter_subcompanydetails_gst_no_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.11 on 2024-06-27 18:13 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0018_alter_clientdetails_gst_no'), + ] + + operations = [ + migrations.AlterField( + model_name='subcompanydetails', + name='GST_No', + field=models.CharField(max_length=50, null=True), + ), + migrations.AlterField( + model_name='sublocationdetails', + name='GST_No', + field=models.CharField(max_length=50, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0020_client_jobposting.py b/skyonnweb/skyonnadmin/migrations/0020_client_jobposting.py new file mode 100644 index 0000000..a8de62f --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0020_client_jobposting.py @@ -0,0 +1,43 @@ +# Generated by Django 5.0.6 on 2024-07-05 07:51 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0019_alter_subcompanydetails_gst_no_and_more'), + ] + + operations = [ + migrations.CreateModel( + name='Client', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('parent_company', models.CharField(max_length=255)), + ], + ), + migrations.CreateModel( + name='JobPosting', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('JobID', models.CharField(max_length=100, unique=True)), + ('Location', models.CharField(max_length=255)), + ('SPOC', models.CharField(max_length=255)), + ('SPOC2', models.CharField(blank=True, max_length=255, null=True)), + ('StartDate', models.DateField()), + ('CloseDate', models.DateField()), + ('BudgetMin', models.DecimalField(decimal_places=2, max_digits=10)), + ('BudgetMax', models.DecimalField(decimal_places=2, max_digits=10)), + ('Header', models.CharField(max_length=255)), + ('job_description', models.TextField()), + ('Type', models.CharField(max_length=50)), + ('Experience_in_Yrs', models.CharField(max_length=50)), + ('NoOfPosting', models.IntegerField()), + ('SpecialInstructions', models.TextField(blank=True, null=True)), + ('JD', models.FileField(upload_to='JD/')), + ('Client', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='skyonnadmin.client')), + ], + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0021_alter_jobposting_client.py b/skyonnweb/skyonnadmin/migrations/0021_alter_jobposting_client.py new file mode 100644 index 0000000..4977882 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0021_alter_jobposting_client.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.6 on 2024-07-05 07:53 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0020_client_jobposting'), + ] + + operations = [ + migrations.AlterField( + model_name='jobposting', + name='Client', + field=models.CharField(blank=True, max_length=100, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0022_rename_job_description_jobposting_jobdescription_and_more.py b/skyonnweb/skyonnadmin/migrations/0022_rename_job_description_jobposting_jobdescription_and_more.py new file mode 100644 index 0000000..77ff8c6 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0022_rename_job_description_jobposting_jobdescription_and_more.py @@ -0,0 +1,24 @@ +# Generated by Django 5.0.6 on 2024-07-05 09:19 + +import skyonnadmin.models +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0021_alter_jobposting_client'), + ] + + operations = [ + migrations.RenameField( + model_name='jobposting', + old_name='job_description', + new_name='JobDescription', + ), + migrations.AlterField( + model_name='jobposting', + name='JD', + field=models.FileField(upload_to='JD/', validators=[skyonnadmin.models.validate_file_extension]), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0023_spoc_alter_jobposting_budgetmax_and_more.py b/skyonnweb/skyonnadmin/migrations/0023_spoc_alter_jobposting_budgetmax_and_more.py new file mode 100644 index 0000000..09d2187 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0023_spoc_alter_jobposting_budgetmax_and_more.py @@ -0,0 +1,40 @@ +# Generated by Django 5.0.6 on 2024-07-23 05:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0022_rename_job_description_jobposting_jobdescription_and_more'), + ] + + operations = [ + migrations.CreateModel( + name='SPOC', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ], + ), + migrations.AlterField( + model_name='jobposting', + name='BudgetMax', + field=models.DecimalField(decimal_places=2, max_digits=20), + ), + migrations.AlterField( + model_name='jobposting', + name='BudgetMin', + field=models.DecimalField(decimal_places=2, max_digits=20), + ), + migrations.AlterField( + model_name='jobposting', + name='JD', + field=models.FileField(null=True, upload_to='JD'), + ), + migrations.AlterField( + model_name='jobposting', + name='JobID', + field=models.CharField(max_length=100), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0024_alter_jobposting_budgetmax_and_more.py b/skyonnweb/skyonnadmin/migrations/0024_alter_jobposting_budgetmax_and_more.py new file mode 100644 index 0000000..9fc1b7e --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0024_alter_jobposting_budgetmax_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 5.0.6 on 2024-07-23 08:35 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0023_spoc_alter_jobposting_budgetmax_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='jobposting', + name='BudgetMax', + field=models.DecimalField(decimal_places=2, max_digits=10), + ), + migrations.AlterField( + model_name='jobposting', + name='BudgetMin', + field=models.DecimalField(decimal_places=2, max_digits=10), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0025_delete_jobposting_delete_spoc.py b/skyonnweb/skyonnadmin/migrations/0025_delete_jobposting_delete_spoc.py new file mode 100644 index 0000000..099d8b3 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0025_delete_jobposting_delete_spoc.py @@ -0,0 +1,19 @@ +# Generated by Django 5.0.6 on 2024-07-23 09:59 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0024_alter_jobposting_budgetmax_and_more'), + ] + + operations = [ + migrations.DeleteModel( + name='JobPosting', + ), + migrations.DeleteModel( + name='SPOC', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0026_rename_name_addcontact_firstname_and_more.py b/skyonnweb/skyonnadmin/migrations/0026_rename_name_addcontact_firstname_and_more.py new file mode 100644 index 0000000..1b34447 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0026_rename_name_addcontact_firstname_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 5.0.6 on 2024-07-26 06:55 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0025_delete_jobposting_delete_spoc'), + ] + + operations = [ + migrations.RenameField( + model_name='addcontact', + old_name='Name', + new_name='FirstName', + ), + migrations.RenameField( + model_name='addcontact', + old_name='location', + new_name='LastName', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0027_remove_addcontact_firstname.py b/skyonnweb/skyonnadmin/migrations/0027_remove_addcontact_firstname.py new file mode 100644 index 0000000..c5e9e59 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0027_remove_addcontact_firstname.py @@ -0,0 +1,17 @@ +# Generated by Django 5.0.6 on 2024-07-26 07:09 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0026_rename_name_addcontact_firstname_and_more'), + ] + + operations = [ + migrations.RemoveField( + model_name='addcontact', + name='FirstName', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0028_addcontact_firstname.py b/skyonnweb/skyonnadmin/migrations/0028_addcontact_firstname.py new file mode 100644 index 0000000..06d6e27 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0028_addcontact_firstname.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.6 on 2024-07-26 07:10 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0027_remove_addcontact_firstname'), + ] + + operations = [ + migrations.AddField( + model_name='addcontact', + name='FirstName', + field=models.CharField(max_length=100, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0029_remove_addcontact_firstname_and_more.py b/skyonnweb/skyonnadmin/migrations/0029_remove_addcontact_firstname_and_more.py new file mode 100644 index 0000000..86b7bca --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0029_remove_addcontact_firstname_and_more.py @@ -0,0 +1,21 @@ +# Generated by Django 5.0.6 on 2024-07-26 07:11 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0028_addcontact_firstname'), + ] + + operations = [ + migrations.RemoveField( + model_name='addcontact', + name='FirstName', + ), + migrations.RemoveField( + model_name='addcontact', + name='LastName', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0030_addcontact_firstname_addcontact_lastname.py b/skyonnweb/skyonnadmin/migrations/0030_addcontact_firstname_addcontact_lastname.py new file mode 100644 index 0000000..3d8b964 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0030_addcontact_firstname_addcontact_lastname.py @@ -0,0 +1,23 @@ +# Generated by Django 5.0.6 on 2024-07-26 07:13 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0029_remove_addcontact_firstname_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='addcontact', + name='FirstName', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='addcontact', + name='LastName', + field=models.CharField(blank=True, max_length=50, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0031_remove_addcontact_firstname_and_more.py b/skyonnweb/skyonnadmin/migrations/0031_remove_addcontact_firstname_and_more.py new file mode 100644 index 0000000..d8e052c --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0031_remove_addcontact_firstname_and_more.py @@ -0,0 +1,21 @@ +# Generated by Django 4.2.11 on 2024-07-30 10:06 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0030_addcontact_firstname_addcontact_lastname'), + ] + + operations = [ + migrations.RemoveField( + model_name='addcontact', + name='FirstName', + ), + migrations.RemoveField( + model_name='addcontact', + name='LastName', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0032_addcontact_firstname_addcontact_lastname.py b/skyonnweb/skyonnadmin/migrations/0032_addcontact_firstname_addcontact_lastname.py new file mode 100644 index 0000000..76d5b1a --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0032_addcontact_firstname_addcontact_lastname.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.11 on 2024-07-30 10:06 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0031_remove_addcontact_firstname_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='addcontact', + name='FirstName', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='addcontact', + name='LastName', + field=models.CharField(blank=True, max_length=50, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0033_remove_addcontact_firstname_and_more.py b/skyonnweb/skyonnadmin/migrations/0033_remove_addcontact_firstname_and_more.py new file mode 100644 index 0000000..994a475 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0033_remove_addcontact_firstname_and_more.py @@ -0,0 +1,21 @@ +# Generated by Django 4.2.11 on 2024-07-30 10:08 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0032_addcontact_firstname_addcontact_lastname'), + ] + + operations = [ + migrations.RemoveField( + model_name='addcontact', + name='FirstName', + ), + migrations.RemoveField( + model_name='addcontact', + name='LastName', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0034_addcontact_firstname_addcontact_lastname.py b/skyonnweb/skyonnadmin/migrations/0034_addcontact_firstname_addcontact_lastname.py new file mode 100644 index 0000000..2a84f63 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0034_addcontact_firstname_addcontact_lastname.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.11 on 2024-07-30 10:08 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0033_remove_addcontact_firstname_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='addcontact', + name='FirstName', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='addcontact', + name='LastName', + field=models.CharField(blank=True, max_length=50, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0035_addcontact_contact_id.py b/skyonnweb/skyonnadmin/migrations/0035_addcontact_contact_id.py new file mode 100644 index 0000000..bdbd7de --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0035_addcontact_contact_id.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.11 on 2024-08-01 06:59 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0034_addcontact_firstname_addcontact_lastname'), + ] + + operations = [ + migrations.AddField( + model_name='addcontact', + name='Contact_id', + field=models.CharField(max_length=20, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0036_remove_addcontact_contact_id.py b/skyonnweb/skyonnadmin/migrations/0036_remove_addcontact_contact_id.py new file mode 100644 index 0000000..94a7cfa --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0036_remove_addcontact_contact_id.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.11 on 2024-08-09 10:32 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0035_addcontact_contact_id'), + ] + + operations = [ + migrations.RemoveField( + model_name='addcontact', + name='Contact_id', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0037_addcontact_contact_id.py b/skyonnweb/skyonnadmin/migrations/0037_addcontact_contact_id.py new file mode 100644 index 0000000..b2e070c --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0037_addcontact_contact_id.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.11 on 2024-08-09 10:32 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0036_remove_addcontact_contact_id'), + ] + + operations = [ + migrations.AddField( + model_name='addcontact', + name='Contact_id', + field=models.CharField(max_length=20, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0038_remove_addcontact_firstname_and_more.py b/skyonnweb/skyonnadmin/migrations/0038_remove_addcontact_firstname_and_more.py new file mode 100644 index 0000000..0680e4c --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0038_remove_addcontact_firstname_and_more.py @@ -0,0 +1,21 @@ +# Generated by Django 4.2.11 on 2024-08-09 10:33 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0037_addcontact_contact_id'), + ] + + operations = [ + migrations.RemoveField( + model_name='addcontact', + name='FirstName', + ), + migrations.RemoveField( + model_name='addcontact', + name='LastName', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0039_addcontact_firstname_addcontact_lastname.py b/skyonnweb/skyonnadmin/migrations/0039_addcontact_firstname_addcontact_lastname.py new file mode 100644 index 0000000..482789d --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0039_addcontact_firstname_addcontact_lastname.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.11 on 2024-08-09 10:34 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0038_remove_addcontact_firstname_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='addcontact', + name='FirstName', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='addcontact', + name='LastName', + field=models.CharField(blank=True, max_length=50, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0040_internalteam.py b/skyonnweb/skyonnadmin/migrations/0040_internalteam.py new file mode 100644 index 0000000..48df0f4 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0040_internalteam.py @@ -0,0 +1,33 @@ +# Generated by Django 4.2.11 on 2024-08-13 09:57 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0039_addcontact_firstname_addcontact_lastname'), + ] + + operations = [ + migrations.CreateModel( + name='InternalTeam', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('FirstName', models.CharField(max_length=100, null=True)), + ('LastName', models.CharField(max_length=100, null=True)), + ('Designation', models.CharField(max_length=100, null=True)), + ('Department', models.CharField(max_length=100, null=True)), + ('Address_1', models.CharField(max_length=255, null=True)), + ('Address_2', models.CharField(blank=True, max_length=255, null=True)), + ('City', models.CharField(max_length=100)), + ('State', models.CharField(max_length=100, null=True)), + ('Pincode', models.CharField(max_length=6, null=True)), + ('Country', models.CharField(max_length=100, null=True)), + ('PhoneNo1', models.CharField(max_length=15, null=True)), + ('PhoneNo2', models.CharField(blank=True, max_length=15, null=True)), + ('Email1', models.EmailField(max_length=254, null=True)), + ('Email2', models.EmailField(max_length=254, null=True)), + ], + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0041_internalteam_band.py b/skyonnweb/skyonnadmin/migrations/0041_internalteam_band.py new file mode 100644 index 0000000..8850485 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0041_internalteam_band.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.11 on 2024-08-30 09:41 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0040_internalteam'), + ] + + operations = [ + migrations.AddField( + model_name='internalteam', + name='Band', + field=models.CharField(max_length=50, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0042_internalteam_login_internalteam_password.py b/skyonnweb/skyonnadmin/migrations/0042_internalteam_login_internalteam_password.py new file mode 100644 index 0000000..12f646a --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0042_internalteam_login_internalteam_password.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.11 on 2024-08-30 10:21 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0041_internalteam_band'), + ] + + operations = [ + migrations.AddField( + model_name='internalteam', + name='Login', + field=models.EmailField(max_length=254, null=True), + ), + migrations.AddField( + model_name='internalteam', + name='Password', + field=models.CharField(max_length=50, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0043_internalteam_user_id.py b/skyonnweb/skyonnadmin/migrations/0043_internalteam_user_id.py new file mode 100644 index 0000000..53ab57c --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0043_internalteam_user_id.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.11 on 2024-09-02 06:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0042_internalteam_login_internalteam_password'), + ] + + operations = [ + migrations.AddField( + model_name='internalteam', + name='user_id', + field=models.CharField(max_length=50, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0044_alter_internalteam_email2.py b/skyonnweb/skyonnadmin/migrations/0044_alter_internalteam_email2.py new file mode 100644 index 0000000..e8bf8c7 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0044_alter_internalteam_email2.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.1 on 2024-09-16 07:50 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0043_internalteam_user_id'), + ] + + operations = [ + migrations.AlterField( + model_name='internalteam', + name='Email2', + field=models.EmailField(max_length=40, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0045_alter_internalteam_email2.py b/skyonnweb/skyonnadmin/migrations/0045_alter_internalteam_email2.py new file mode 100644 index 0000000..fdf89cd --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0045_alter_internalteam_email2.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.1 on 2024-09-16 07:55 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0044_alter_internalteam_email2'), + ] + + operations = [ + migrations.AlterField( + model_name='internalteam', + name='Email2', + field=models.EmailField(max_length=50, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0046_spoc.py b/skyonnweb/skyonnadmin/migrations/0046_spoc.py new file mode 100644 index 0000000..bd12d85 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0046_spoc.py @@ -0,0 +1,20 @@ +# Generated by Django 5.1.1 on 2024-09-16 07:56 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0045_alter_internalteam_email2'), + ] + + operations = [ + migrations.CreateModel( + name='SPOC', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, null=True)), + ], + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0047_delete_internalteam.py b/skyonnweb/skyonnadmin/migrations/0047_delete_internalteam.py new file mode 100644 index 0000000..9e5dfc5 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0047_delete_internalteam.py @@ -0,0 +1,16 @@ +# Generated by Django 5.1.1 on 2024-09-16 07:59 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0046_spoc'), + ] + + operations = [ + migrations.DeleteModel( + name='InternalTeam', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0048_internalteam.py b/skyonnweb/skyonnadmin/migrations/0048_internalteam.py new file mode 100644 index 0000000..1ff22aa --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0048_internalteam.py @@ -0,0 +1,37 @@ +# Generated by Django 5.1.1 on 2024-09-16 07:59 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0047_delete_internalteam'), + ] + + operations = [ + migrations.CreateModel( + name='InternalTeam', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('FirstName', models.CharField(max_length=100, null=True)), + ('LastName', models.CharField(max_length=100, null=True)), + ('Designation', models.CharField(max_length=100, null=True)), + ('Department', models.CharField(max_length=100, null=True)), + ('Address_1', models.CharField(max_length=255, null=True)), + ('Address_2', models.CharField(blank=True, max_length=255, null=True)), + ('City', models.CharField(max_length=100)), + ('State', models.CharField(max_length=100, null=True)), + ('Pincode', models.CharField(max_length=6, null=True)), + ('Country', models.CharField(max_length=100, null=True)), + ('PhoneNo1', models.CharField(max_length=15, null=True)), + ('PhoneNo2', models.CharField(blank=True, max_length=15, null=True)), + ('Email1', models.EmailField(max_length=254, null=True)), + ('Email2', models.EmailField(max_length=50, null=True)), + ('Band', models.CharField(max_length=50, null=True)), + ('Login', models.EmailField(max_length=254, null=True)), + ('Password', models.CharField(max_length=50, null=True)), + ('user_id', models.CharField(max_length=50, null=True)), + ], + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0049_delete_addcontact.py b/skyonnweb/skyonnadmin/migrations/0049_delete_addcontact.py new file mode 100644 index 0000000..9938ce9 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0049_delete_addcontact.py @@ -0,0 +1,16 @@ +# Generated by Django 5.1.1 on 2024-09-16 08:39 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0048_internalteam'), + ] + + operations = [ + migrations.DeleteModel( + name='AddContact', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0050_addcontact.py b/skyonnweb/skyonnadmin/migrations/0050_addcontact.py new file mode 100644 index 0000000..e4c530b --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0050_addcontact.py @@ -0,0 +1,28 @@ +# Generated by Django 5.1.1 on 2024-09-16 08:40 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0049_delete_addcontact'), + ] + + operations = [ + migrations.CreateModel( + name='AddContact', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('Contact_id', models.CharField(max_length=20, null=True)), + ('Company', models.CharField(blank=True, max_length=100, null=True)), + ('Sub_company', models.CharField(blank=True, max_length=100, null=True)), + ('FirstName', models.CharField(max_length=100, null=True)), + ('LastName', models.CharField(blank=True, max_length=50, null=True)), + ('Department', models.CharField(blank=True, max_length=50, null=True)), + ('Designation', models.CharField(blank=True, max_length=50, null=True)), + ('Phone_number', models.CharField(max_length=10, null=True, unique=True)), + ('Email', models.EmailField(max_length=254, null=True, unique=True)), + ], + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0051_alter_addcontact_contact_id.py b/skyonnweb/skyonnadmin/migrations/0051_alter_addcontact_contact_id.py new file mode 100644 index 0000000..2540843 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0051_alter_addcontact_contact_id.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.1 on 2024-09-16 08:40 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0050_addcontact'), + ] + + operations = [ + migrations.AlterField( + model_name='addcontact', + name='Contact_id', + field=models.CharField(max_length=30, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0052_remove_addcontact_contact_id.py b/skyonnweb/skyonnadmin/migrations/0052_remove_addcontact_contact_id.py new file mode 100644 index 0000000..dd307c9 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0052_remove_addcontact_contact_id.py @@ -0,0 +1,17 @@ +# Generated by Django 5.1.1 on 2024-09-16 08:41 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0051_alter_addcontact_contact_id'), + ] + + operations = [ + migrations.RemoveField( + model_name='addcontact', + name='Contact_id', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0053_addcontact_contact_id.py b/skyonnweb/skyonnadmin/migrations/0053_addcontact_contact_id.py new file mode 100644 index 0000000..03a17e8 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0053_addcontact_contact_id.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.1 on 2024-09-16 08:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0052_remove_addcontact_contact_id'), + ] + + operations = [ + migrations.AddField( + model_name='addcontact', + name='Contact_id', + field=models.CharField(max_length=30, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0054_remove_addcontact_firstname_and_more.py b/skyonnweb/skyonnadmin/migrations/0054_remove_addcontact_firstname_and_more.py new file mode 100644 index 0000000..133978f --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0054_remove_addcontact_firstname_and_more.py @@ -0,0 +1,21 @@ +# Generated by Django 5.1.1 on 2024-09-16 08:43 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0053_addcontact_contact_id'), + ] + + operations = [ + migrations.RemoveField( + model_name='addcontact', + name='FirstName', + ), + migrations.RemoveField( + model_name='addcontact', + name='LastName', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0055_addcontact_firstname_addcontact_lastname.py b/skyonnweb/skyonnadmin/migrations/0055_addcontact_firstname_addcontact_lastname.py new file mode 100644 index 0000000..f734639 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0055_addcontact_firstname_addcontact_lastname.py @@ -0,0 +1,23 @@ +# Generated by Django 5.1.1 on 2024-09-16 08:43 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0054_remove_addcontact_firstname_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='addcontact', + name='FirstName', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='addcontact', + name='LastName', + field=models.CharField(blank=True, max_length=50, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0056_delete_internalteam.py b/skyonnweb/skyonnadmin/migrations/0056_delete_internalteam.py new file mode 100644 index 0000000..8f2d36e --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0056_delete_internalteam.py @@ -0,0 +1,16 @@ +# Generated by Django 5.1.1 on 2024-09-19 10:27 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0055_addcontact_firstname_addcontact_lastname'), + ] + + operations = [ + migrations.DeleteModel( + name='InternalTeam', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0057_internalteam.py b/skyonnweb/skyonnadmin/migrations/0057_internalteam.py new file mode 100644 index 0000000..4c98504 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0057_internalteam.py @@ -0,0 +1,37 @@ +# Generated by Django 5.1.1 on 2024-09-19 10:27 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0056_delete_internalteam'), + ] + + operations = [ + migrations.CreateModel( + name='InternalTeam', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('FirstName', models.CharField(max_length=100, null=True)), + ('LastName', models.CharField(max_length=100, null=True)), + ('Designation', models.CharField(max_length=100, null=True)), + ('Department', models.CharField(max_length=100, null=True)), + ('Address_1', models.CharField(max_length=255, null=True)), + ('Address_2', models.CharField(blank=True, max_length=255, null=True)), + ('City', models.CharField(max_length=100)), + ('State', models.CharField(max_length=100, null=True)), + ('Pincode', models.CharField(max_length=6, null=True)), + ('Country', models.CharField(max_length=100, null=True)), + ('PhoneNo1', models.CharField(max_length=15, null=True)), + ('PhoneNo2', models.CharField(blank=True, max_length=15, null=True)), + ('Email1', models.EmailField(max_length=254, null=True)), + ('Email2', models.EmailField(max_length=50, null=True)), + ('Band', models.CharField(max_length=50, null=True)), + ('Login', models.EmailField(max_length=254, null=True)), + ('Password', models.CharField(max_length=50, null=True)), + ('user_id', models.CharField(max_length=50, null=True)), + ], + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0058_remove_addcontact_contact_id.py b/skyonnweb/skyonnadmin/migrations/0058_remove_addcontact_contact_id.py new file mode 100644 index 0000000..4fc569a --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0058_remove_addcontact_contact_id.py @@ -0,0 +1,17 @@ +# Generated by Django 5.1.1 on 2024-09-19 10:38 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0057_internalteam'), + ] + + operations = [ + migrations.RemoveField( + model_name='addcontact', + name='Contact_id', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0059_addcontact_contact_id.py b/skyonnweb/skyonnadmin/migrations/0059_addcontact_contact_id.py new file mode 100644 index 0000000..96b15a2 --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0059_addcontact_contact_id.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.1 on 2024-09-19 10:38 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0058_remove_addcontact_contact_id'), + ] + + operations = [ + migrations.AddField( + model_name='addcontact', + name='Contact_id', + field=models.CharField(max_length=30, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0060_remove_addcontact_firstname_and_more.py b/skyonnweb/skyonnadmin/migrations/0060_remove_addcontact_firstname_and_more.py new file mode 100644 index 0000000..f5b4e1f --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0060_remove_addcontact_firstname_and_more.py @@ -0,0 +1,21 @@ +# Generated by Django 5.1.1 on 2024-09-19 10:40 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0059_addcontact_contact_id'), + ] + + operations = [ + migrations.RemoveField( + model_name='addcontact', + name='FirstName', + ), + migrations.RemoveField( + model_name='addcontact', + name='LastName', + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0061_addcontact_firstname_addcontact_lastname.py b/skyonnweb/skyonnadmin/migrations/0061_addcontact_firstname_addcontact_lastname.py new file mode 100644 index 0000000..303a2ea --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0061_addcontact_firstname_addcontact_lastname.py @@ -0,0 +1,23 @@ +# Generated by Django 5.1.1 on 2024-09-19 10:40 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0060_remove_addcontact_firstname_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='addcontact', + name='FirstName', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='addcontact', + name='LastName', + field=models.CharField(blank=True, max_length=50, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0062_remove_internalteam_phoneno2_internalteam_landnumber.py b/skyonnweb/skyonnadmin/migrations/0062_remove_internalteam_phoneno2_internalteam_landnumber.py new file mode 100644 index 0000000..7e084ed --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0062_remove_internalteam_phoneno2_internalteam_landnumber.py @@ -0,0 +1,22 @@ +# Generated by Django 4.2.11 on 2024-12-03 10:56 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0061_addcontact_firstname_addcontact_lastname'), + ] + + operations = [ + migrations.RemoveField( + model_name='internalteam', + name='PhoneNo2', + ), + migrations.AddField( + model_name='internalteam', + name='LandNumber', + field=models.CharField(blank=True, max_length=25, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/0063_remove_internalteam_band_internalteam_level.py b/skyonnweb/skyonnadmin/migrations/0063_remove_internalteam_band_internalteam_level.py new file mode 100644 index 0000000..3f6a39f --- /dev/null +++ b/skyonnweb/skyonnadmin/migrations/0063_remove_internalteam_band_internalteam_level.py @@ -0,0 +1,22 @@ +# Generated by Django 4.2.11 on 2024-12-03 10:57 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('skyonnadmin', '0062_remove_internalteam_phoneno2_internalteam_landnumber'), + ] + + operations = [ + migrations.RemoveField( + model_name='internalteam', + name='Band', + ), + migrations.AddField( + model_name='internalteam', + name='Level', + field=models.CharField(max_length=50, null=True), + ), + ] diff --git a/skyonnweb/skyonnadmin/migrations/__init__.py b/skyonnweb/skyonnadmin/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/skyonnweb/skyonnadmin/models.py b/skyonnweb/skyonnadmin/models.py new file mode 100644 index 0000000..74f66aa --- /dev/null +++ b/skyonnweb/skyonnadmin/models.py @@ -0,0 +1,186 @@ +from django.contrib.auth.models import AbstractBaseUser, BaseUserManager +from django.db import models +from django.core.exceptions import ValidationError +import os + + +class CustomUserManager(BaseUserManager): + def create_user(self, phone, password=None, **extra_fields): + if not phone: + raise ValueError('The Phone number must be set') + user = self.model(phone=phone, **extra_fields) + user.set_password(password) + user.save(using=self._db) + return user + + def create_superuser(self, phone, password=None, **extra_fields): + extra_fields.setdefault('is_staff', True) + extra_fields.setdefault('is_superuser', True) + + if extra_fields.get('is_staff') is not True: + raise ValueError('Superuser must have is_staff=True.') + if extra_fields.get('is_superuser') is not True: + raise ValueError('Superuser must have is_superuser=True.') + + return self.create_user(phone, password, **extra_fields) + + +class skyonnAdmin(AbstractBaseUser): + ADMIN_ID_PREFIX = 'SKYA' # Prefix for AdminId + + first_name = models.CharField(max_length=50) + last_name = models.CharField(max_length=50) + phone = models.CharField(max_length=15, unique=True) + phone_number_2 = models.CharField(max_length=15, blank=True, null=True) + company_email = models.EmailField(null=True) # Additional email field + personal_email = models.EmailField(null=True) # Additional email field + address = models.TextField(null=True) # Additional address field + work_location = models.CharField(max_length=100, null=True) # Additional work location field + picture = models.ImageField(upload_to='profile_pics/', null=True) # Additional picture field + role = models.CharField(max_length=20) # Additional role field + admin_id = models.CharField(max_length=10, unique=True) # AdminId field + + is_active = models.BooleanField(default=True) + is_staff = models.BooleanField(default=False) + + objects = CustomUserManager() + + USERNAME_FIELD = 'phone' + + def save(self, *args, **kwargs): + if not self.admin_id: + last_admin = skyonnAdmin.objects.order_by('-id').first() + if last_admin: + last_id = last_admin.admin_id[4:] # Extract the serial number part + new_id = int(last_id) + 1 + else: + new_id = 1 + self.admin_id = f'{self.ADMIN_ID_PREFIX}{new_id:03d}' + super().save(*args, **kwargs) + + def _str_(self): + return self.phone + + +class SubcompanyDetails(models.Model): + sub_client_id = models.CharField(max_length=20, null=True) + parent_company = models.CharField(max_length=100,null=True) + sub_company = models.CharField(max_length=100,unique=True,null=True) + GST_No = models.CharField(max_length=50, null=True) + location_id = models.CharField(max_length=100,null=True) + address_1 = models.CharField(max_length=200,null=True) + address_2 = models.CharField(max_length=200,null=True) + # Street = models.CharField(max_length=200,null=True) + City = models.CharField(max_length=200, null=True) + State = models.CharField(max_length=200,null=True) + Pincode =models.IntegerField(null=True) + country = models.CharField(max_length=200,null=True) + + + def _str_(self): + return f"{self.parent_company}" + + +class Contact(models.Model): + + # sub_client_id = models.ForeignKey(SubcompanyDetails,on_delete=models.CASCADE) + name = models.CharField(max_length=40,null=True) + designation = models.CharField(max_length=50,null=True) + department = models.CharField(max_length=50,null=True) + phone_no = models.CharField(max_length=50, null=True) + email = models.EmailField(null=True) + location = models.CharField(max_length=102,null=True) + + def _str_(self): + return f"{self.name} - {self.department}" + +class ClientDetails(models.Model): + # STATE_CHOICES =(('Andhra Pradesh','andhra Pradesh'),('Arunachal Pradesh','arunachal Pradesh'),('assam','Assam'), + # ('Bihar','bihar'),('Chhattisgarh','chhattisgarh'),('Goa','goa'),('Gujarat','Gujarat'),('Haryana','haryana'), + # ('Himachal Pradesh','himachal Pradesh'),('Jharkhand','jharkhand'),('Karnataka','karnataka'), + # ('Kerala','kerala'),) + + client_id = models.CharField(max_length=20, null=True) + parent_company = models.CharField(max_length=100,null=True, unique=True) + GST_No = models.CharField(max_length=50, null=True) + location_Id = models.CharField(max_length=100,null=True) + address_1 = models.CharField(max_length=300,blank=True,null=True) + address_2 = models.CharField(max_length=200,null=True,blank=True) + # Street=models.CharField(max_length=200,null=True) + City = models.CharField(max_length=200, null=True) + state = models.CharField(max_length=300, blank=True, null=True) + Pincode = models.IntegerField(null=True) + country = models.CharField(max_length=200,null=True) + + contacts = models.ManyToManyField(Contact, related_name='contacts') + + def _str_(self): + return f"{self.parent_company} - {self.location_Id}" + +class SublocationDetails(models.Model): + parent_company = models.CharField(max_length=100, null=True) + department = models.CharField(max_length=100, null=True) + GST_No = models.CharField(max_length=50, null=True) + Location = models.CharField(max_length=100, null=True) + address_1 = models.CharField(max_length=300, blank=True, null=True) + address_2 = models.CharField(max_length=200, null=True, blank=True) + City = models.CharField(max_length=200, null=True) + State = models.CharField(max_length=300, blank=True, null=True) + Pincode = models.IntegerField(null=True) + country = models.CharField(max_length=200, null=True) + + +class Locations(models.Model): + location = models.CharField(null=True, max_length=50) + + +class AddContact(models.Model): + Contact_id = models.CharField(max_length=30, null=True) + Company = models.CharField(max_length=100, null=True, blank=True) + Sub_company = models.CharField(max_length=100, null=True, blank=True) + FirstName = models.CharField(max_length=100, null=True) + LastName = models.CharField(max_length=50, null=True, blank=True) + Department = models.CharField(max_length=50, null=True, blank=True) + Designation = models.CharField(max_length=50, null=True, blank=True) + Phone_number = models.CharField(max_length=10, unique=True, null=True) + Email = models.EmailField(unique=True, null=True) + +class Client(models.Model): + parent_company = models.CharField(max_length=255) + + def __str__(self): + return self.parent_company + +def validate_file_extension(value): + ext = os.path.splitext(value.name)[1] # Get file extension + valid_extensions = ['.pdf', '.jpg', '.jpeg'] + if not ext.lower() in valid_extensions: + raise ValidationError('Unsupported file extension. Allowed extensions are: .pdf, .jpg, .jpeg') + +class SPOC(models.Model): + name = models.CharField(max_length=255,null=True) + +class InternalTeam(models.Model): + FirstName = models.CharField(max_length=100, null=True) + LastName = models.CharField(max_length=100, null=True) + Designation = models.CharField(max_length=100, null=True) + Department = models.CharField(max_length=100, null=True) + Address_1 = models.CharField(max_length=255, null=True) + Address_2 = models.CharField(max_length=255, blank=True, null=True) + City = models.CharField(max_length=100) + State = models.CharField(max_length=100, null=True) + Pincode = models.CharField(max_length=6, null=True) + Country = models.CharField(max_length=100, null=True) + PhoneNo1 = models.CharField(max_length=15, null=True) + LandNumber = models.CharField(max_length=25, blank=True, null=True) + Email1 = models.EmailField(null=True) + Email2 = models.EmailField(max_length=50,null=True) + Level = models.CharField(max_length=50, null=True) + + Login = models.EmailField(null=True) + Password = models.CharField(max_length=50, null=True) + user_id = models.CharField(max_length=50, null=True) + + def __str__(self): + return f"{self.FirstName} {self.LastName}" + diff --git a/skyonnweb/skyonnadmin/serializers.py b/skyonnweb/skyonnadmin/serializers.py new file mode 100644 index 0000000..953a451 --- /dev/null +++ b/skyonnweb/skyonnadmin/serializers.py @@ -0,0 +1,10 @@ +from rest_framework import serializers +from .models import SubcompanyDetails + +class DetailsSerializer(serializers.Serializer): + client_details= serializers.ListField(child=serializers.DictField()) + sub_company_details = serializers.ListField(child=serializers.DictField()) + + class Meta: + model = SubcompanyDetails + fields = '__all__' diff --git a/skyonnweb/skyonnadmin/tests.py b/skyonnweb/skyonnadmin/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/skyonnweb/skyonnadmin/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/skyonnweb/skyonnadmin/urls.py b/skyonnweb/skyonnadmin/urls.py new file mode 100644 index 0000000..18fd45e --- /dev/null +++ b/skyonnweb/skyonnadmin/urls.py @@ -0,0 +1,67 @@ +from django.urls import path +from . import views + +urlpatterns = [ + path('', views.home, name='admin_home'), + path('create_admin/', views.create_admin, name='create_admin'), + path('admin_login/', views.admin_login, name='admin_login'), # URL for login + path('validate_admin/', views.validate_admin, name='validate_admin'), + path('get_admin_details/', views.get_admin_details, name='get_admin_details'), + path('admin/dashboard//', views.admin_dashboard, name='dashboard'), + path('admin_logout/', views.logout_view, name='admin_logout'), + # path('client_details/', views.client_details, name='client_details'), + # path('save-details/', views.save_details, name='save_details'), + # path('save-details-subcompany/', views.save_details_subcompany, name='save-details-subcompany'), + # path('api/get_subcompanies/', views.get_locations, name='get_subcompanies'), + # path('get_subcompany_details/', views.get_combined_details, name='get_subcompany_details'), + path('client-details/', views.client_details, name='client-details'), + path('add_subclient/', views.add_subclient, name='add_subclient'), + path('add_client/', views.add_client, name='add_client'), + path('existing_client/', views.existing_client, name='existing_client'), + + path('new_job_postings/', views.new_job_posting, name='new_job_postings'), + + # path('get_contacts/', views.get_contacts, name='get_contacts'), + path('save-details/', views.save_details, name='save_details'), + path('get_GSTNo/', views.get_GSTNo, name='get_GSTNo'), + path('save-details-subcompany/', views.save_details_subcompany, name='save-details-subcompany'), + path('get_parentCompany/', views.get_parentCompany, name='get_parentCompany'), + path('save_sublocation/', views.save_sublocation, name='save_sublocation'), + path('api/get_subcompanies/', views.get_locations, name='get_subcompanies'), + path('get_subcompany_details/', views.get_combined_details, name='get_subcompany_details'), + path('add_new_contact/', views.add_new_contact, name='add_new_contact'), + path('add_location/', views.add_locations, name='add_location'), + path('get_subclients/', views.get_subclients, name='get_subclients'), + path('get_filtered_data/', views.get_filtered_data, name='get_filtered_data'), + path('save_new_entry/', views.save_new_entry, name='save_new_entry'), + path('add_contact/', views.add_contact, name='add_contact'), + path('get_team_details/', views.get_team_details, name='get_team_details'), + path('get_department/', views.get_department, name='get_department'), + path('get_SearchData/', views.get_SearchData, name='get_SearchData'), + path('check_parent_company/', views.check_parent_company, name='check_parent_company'), + path('check_sub_company/', views.check_sub_company, name='check_sub_company'), + # path('save_job_posting/', views.save_job_posting, name='save_job_posting'), + + path('edit_CompanyDetails/', views.edit_CompanyDetails, name='edit_CompanyDetails'), + path('delete_CompanyDetails/', views.delete_CompanyDetails, name='delete_CompanyDetails'), + path('edit_teamDetails/', views.edit_teamDetails, name='edit_teamDetails'), + path('delete_teamDetails/', views.delete_teamDetails, name='delete_teamDetails'), + + path('validate_field/', views.validate_field, name='validate_field'), + path('validate_cell_field/', views.validate_cell_field, name='validate_cell_field'), + + path('Internal_team_details/', views.Internal_team_details, name='Internal_team_details'), + path('save_Internal_team_Details/', views.save_Internal_team_Details, name='save_Internal_team_Details'), + path('validate_internal_team/', views.validate_internal_team, name='validate_internal_team'), + path('validate_internal_team/', views.validate_internal_team, name='validate_internal_team'), + path('existing_employee/', views.existing_employee, name='existing_employee'), + path('validate_existingEmployee/', views.validate_existingEmployee, name='validate_existingEmployee'), + path('delete_internalTeam/', views.delete_internalTeam, name='delete_internalTeam'), + path('edit_internalTeam/', views.edit_internalTeam, name='edit_internalTeam'), + path('print_internalTeam/', views.print_internalTeam, name='print_internalTeam'), + + path('get_row_count/', views.get_row_count, name='get_row_count'), + path('load_excel_data/', views.load_excel_data, name='load_excel_data'), + path('get_employee/', views.get_employee, name='get_employee'), +] + diff --git a/skyonnweb/skyonnadmin/views.py b/skyonnweb/skyonnadmin/views.py new file mode 100644 index 0000000..542e3d9 --- /dev/null +++ b/skyonnweb/skyonnadmin/views.py @@ -0,0 +1,1286 @@ +from django.contrib import messages +from django.contrib.auth import authenticate, login as auth_login, logout +from django.shortcuts import render, redirect, get_object_or_404 +from .models import skyonnAdmin, ClientDetails, SubcompanyDetails, Contact, Locations, AddContact, SublocationDetails,InternalTeam +from django.contrib.auth.hashers import make_password +from django.http import HttpResponse +import random +import string +from django.http import JsonResponse +import json +from django.core.serializers.json import DjangoJSONEncoder +from django.views.decorators.csrf import csrf_exempt +from django.views.decorators.http import require_http_methods +from django.core.exceptions import ObjectDoesNotExist +from .serializers import DetailsSerializer +from django.core.validators import validate_email +from django.core.exceptions import ValidationError +import re +from django.http import JsonResponse +from django.db.models import Q +from django.core.mail import send_mail +import threading +import pandas as pd + +def home(request): + return render(request, 'skyonnadmin/home.html') + + +def create_admin(request): + if request.method == 'POST': + first_name = request.POST['first_name'] + last_name = request.POST['last_name'] + phone_number = request.POST['phone'] + phone_number_2 = request.POST.get('phone_2') + company_email = request.POST['company_email'] + personal_email = request.POST.get('personal_email') + address = request.POST['address'] + work_location = request.POST['work_location'] + role = 'admin' + password = request.POST['password'] # Assuming there's a password field in the form + hashed_password = make_password(password) + + picture = request.FILES.get('picture') + + # Generate admin ID based on the last ID in the database + last_admin = skyonnAdmin.objects.order_by('-id').first() + if last_admin: + last_id = int(last_admin.admin_id[4:]) # Extract the serial number part and convert to int + new_id = last_id + 1 + else: + new_id = 1 + admin_id = f'SKYA{new_id:03d}' # Construct the new admin ID + + # Create the admin user + admin = skyonnAdmin.objects.create( + first_name=first_name, + last_name=last_name, + phone=phone_number, + phone_number_2=phone_number_2, + company_email=company_email, + personal_email=personal_email, + address=address, + work_location=work_location, + role=role, + admin_id=admin_id, + password=hashed_password, + picture= picture + ) + print((admin.first_name, admin.last_name)) + admin.backend = 'user.backend.PhoneAuthenticationBackend' + auth_login(request, admin) + + return JsonResponse( + {'success': 'Login successful', 'redirect_url': f'/skyonnadmin/admin/dashboard/{admin.admin_id}'}) + else: + return render(request, 'skyonnadmin/home.html') + +def validate_admin(request): + if request.method == 'GET': + email1 = request.GET.get('company_email') + email2 = request.GET.get('personal_email') + phone_number1 = request.GET.get('phone') + phone_number2 = request.GET.get('phone_2') + response = { + 'exists': False + } + if email1 and (skyonnAdmin.objects.filter(company_email=email1).exists() or + skyonnAdmin.objects.filter(personal_email=email1).exists()): + response['exists'] = True + + if email2 and (skyonnAdmin.objects.filter(company_email=email2).exists() or + skyonnAdmin.objects.filter(personal_email=email2).exists()): + response['exists'] = True + + if phone_number1 and (skyonnAdmin.objects.filter(phone=phone_number1).exists() or + skyonnAdmin.objects.filter(phone_number_2=phone_number1).exists()): + response['exists'] = True + + if phone_number2 and (skyonnAdmin.objects.filter(phone=phone_number2).exists() or + skyonnAdmin.objects.filter(phone_number_2=phone_number2).exists()): + response['exists'] = True + + return JsonResponse(response) + + +def admin_login(request): + if request.method == 'POST': + phone = request.POST.get('phone') + password = request.POST.get('password') + + if not phone and 'phone' in request.POST: + return JsonResponse({'error': 'Please fill the phone number field.'}, status=400) + if not password and 'password' in request.POST: # Validate password if it's present + return JsonResponse({'error': 'Please fill the password field.'}, status=400) + + admin = skyonnAdmin.objects.filter(phone=phone).first() + if admin is None: + return JsonResponse({'error': 'Incorrect phone number.'}, status=404) + + if password: + if not admin.check_password(password): + return JsonResponse({'error': 'Incorrect password.'}, status=401) + + return JsonResponse( + {'success': 'Login successful', 'redirect_url': f'/skyonnadmin/admin/dashboard/{admin.admin_id}'}) + + return JsonResponse({'success': 'Phone number is valid.'}, status=200) + + return JsonResponse({'error': 'Invalid request method.'}, status=405) + + +def admin_dashboard(request, admin_id): + admin = get_object_or_404(skyonnAdmin, admin_id=admin_id) + + # Get the manager's first name + first_name = admin.first_name.capitalize() + full_name = f"{first_name}" + print(full_name) + + return render(request, 'skyonnadmin/admin_dashboard.html', {'first_name': full_name, 'admin_id': admin_id,'picture': admin.picture}) + # Admin dashboard logic goes here + + +def logout_view(request): + logout(request) + return redirect('admin_home') + +def get_admin_details(request): + admin_id = request.GET.get('admin_id', None) + print(admin_id) + admin = get_object_or_404(skyonnAdmin, admin_id=admin_id) + print('admin:', admin) + + admin_picture = admin.picture.url + + admin_data = { + 'first_name': admin.first_name, + 'last_name': admin.last_name, + 'phone': admin.phone, + 'phone_number_2': admin.phone_number_2, + 'company_email': admin.company_email, + 'personal_email': admin.personal_email, + 'address': admin.address, + 'work_location': admin.work_location, + 'admin_picture': admin_picture + } + return JsonResponse({'admin_data': admin_data}) + + +def client_details(request): + return render(request, 'skyonnadmin/client_details.html') + + +def add_subclient(request): + admin_id = request.GET.get('admin_id', None) + clients = ClientDetails.objects.all() + return render(request, 'skyonnadmin/add_subclient.html', {'clients': clients, 'admin_id': admin_id}) + + +def add_client(request): + admin_id = request.GET.get('admin_id', None) + print(admin_id) + clients = ClientDetails.objects.all() + return render(request, 'skyonnadmin/add_client.html', {'clients': clients, 'admin_id': admin_id}) + + +def existing_client(request): + clients = ClientDetails.objects.all() + return render(request, 'skyonnadmin/existing_client.html', {'clients': clients}) + +def new_job_posting(request): + admin_id = request.GET.get('admin_id', None) + return render(request, 'skyonnadmin/new_job_posting.html', {'admin_id': admin_id}) + +def add_new_contact(request): + clients = ClientDetails.objects.all() + sub_clients = SubcompanyDetails.objects.all() + return render(request, 'skyonnadmin/add_new_contact.html',{'clients': clients,'sub_clients': sub_clients}) + + +@csrf_exempt +def save_details(request): + if request.method == 'POST': + + # Extract data from the first form + parent_company = request.POST.get('ParentCompany', '') + locationId = request.POST.get('Location_Id', '') + GST_No = request.POST.get('GSTNo', '') + address_1 = request.POST.get('Address_1', '') + state = request.POST.get('State', '') + # Street = request.POST.get('Street', '') + City = request.POST.get('City', '') + country = request.POST.get('country', '') + address_2 = request.POST.get('Address_2', '') + Pincode = request.POST.get('Pincode', '') + + client_id = generate_client_id(parent_company) + print(client_id) + if not parent_company or not locationId or not GST_No or not address_1 or not state or not City or not country or not Pincode: + return JsonResponse({'status': 'error','message': 'Error while saving client.Please fill required fields'}, + status=400) + # if ClientDetails.objects.filter(parent_company=parent_company.upper()).exists(): + # return JsonResponse({'status': 'error','field': 'ParentCompany', 'message': 'Parent Company already exists'}, status=400) + # # Save data into the database + parent_company_proper = parent_company.title() + + # Check for duplicate ParentCompany + if ClientDetails.objects.filter(parent_company=parent_company_proper).exists(): + return JsonResponse( + {'status': 'error', 'field': 'ParentCompany', 'message': 'Parent Company already exists'}, status=400) + + job_details = ClientDetails( + parent_company=parent_company_proper, + location_Id=locationId, + GST_No=GST_No, + address_1=address_1, + state=state, + # Street= Street, + City=City, + country=country, + address_2=address_2, + Pincode=Pincode, + client_id=client_id, + ) + job_details.save() + admin_id = request.GET.get('admin_id', None) + print(admin_id) + return JsonResponse({'status': 'success', 'message': 'Client saved successfully.'}) + else: + return HttpResponse('Invalid request method') + + +def check_parent_company(request): + if request.method == 'GET': + parent_company = request.GET.get('ParentCompany', '').strip().upper() + print(parent_company) + exists = ClientDetails.objects.filter(parent_company=parent_company).exists() + return JsonResponse({'exists': exists}) + return JsonResponse({'error': 'Invalid request method'}, status=400) + +def get_parentCompany(request): + clients = ClientDetails.objects.values('parent_company') + print(clients) + return JsonResponse(list(clients), safe=False) + +def save_sublocation(request): + if request.method == 'POST': + parent_company = request.POST.get('ParentCompany', '') + department = request.POST.get('Department', '') + Location = request.POST.get('Location', '') + GST_No = request.POST.get('GSTNo', '') + address_1 = request.POST.get('Address_1', '') + address_2 = request.POST.get('Address_2', '') + # Street = request.POST.get('Street', '') + City = request.POST.get('City', '') + State = request.POST.get('State', '') + Pincode = request.POST.get('Pincode', '') + country = request.POST.get('country', '') + + if not parent_company or not department or not Location or not GST_No or not address_1 or not State or not City or not country or not Pincode: + return JsonResponse({'status': 'error', 'message': 'Error while saving Sub_Location.Please fill required fields'}, + status=400) + + # Save data into the database + job_details = SublocationDetails( + parent_company=parent_company, + department= department, + Location=Location, + GST_No=GST_No, + address_1=address_1, + address_2=address_2, + # Street = Street, + City=City, + State=State, + Pincode=Pincode, + country=country, ) + job_details.save() + admin_id = request.GET.get('admin_id', None) + print(admin_id) + return JsonResponse({'status': 'success', 'message': 'sublocation saved successfully.'}) + else: + return JsonResponse({'status': 'error', 'message': 'Invalid request method'}, status=400) + +def get_GSTNo(request): + if request.method == 'GET': + parent_company = request.GET.get('ParentCompany') + gst_no = ClientDetails.objects.filter(parent_company=parent_company).values('GST_No') + gst = list(gst_no) + print(gst) + return JsonResponse(gst[0],safe=False) + else: + return JsonResponse({'error': 'Invalid request'}) + + +@csrf_exempt +def save_details_subcompany(request): + print("00came") + if request.method == 'POST': + # Extract data from the first form + parent_company = request.POST.get('ParentCompany', '') + sub_company = request.POST.get('SubCompany', '') + location_id = request.POST.get('Location_Id', '') + GST_No = request.POST.get('GSTNo', '') + address_1 = request.POST.get('Address_1', '') + address_2 = request.POST.get('Address_2', '') + # Street = request.POST.get('Street', '') + City = request.POST.get('City', '') + State = request.POST.get('State', '') + Pincode = request.POST.get('Pincode', '') + country = request.POST.get('country', '') + + sub_client_id = generate_client_id(parent_company) + print(sub_client_id) + if not parent_company or not sub_company or not location_id or not address_1 or not State or not City or not country or not Pincode: + return JsonResponse({'status': 'error', 'message': 'Error while saving Sub_client.Please fill required fields'}, + status=400) + if SubcompanyDetails.objects.filter(sub_company=sub_company.title()).exists(): + return JsonResponse({'status': 'error','field': 'SubCompany', 'message': 'Sub_Company already exists'}, status=400) + # Save data into the database + job_details = SubcompanyDetails( + parent_company=parent_company, + sub_company=sub_company.title(), + location_id=location_id, + GST_No=GST_No , + address_1=address_1, + address_2=address_2, + # Street = Street, + City = City, + State = State, + Pincode = Pincode, + country= country, + sub_client_id=sub_client_id, + + ) + job_details.save() + admin_id = request.GET.get('admin_id', None) + print(admin_id) + return JsonResponse({'status': 'success', 'message': 'subclient saved successfully.'}) + + else: + return JsonResponse({'status': 'error', 'message': 'Invalid request method'}, status=400) + +def check_sub_company(request): + if request.method == 'GET': + sub_company = request.GET.get('SubCompany', '').strip().upper() + print(sub_company) + exists = SubcompanyDetails.objects.filter(sub_company=sub_company).exists() + return JsonResponse({'exists': exists}) + return JsonResponse({'error': 'Invalid request method'}, status=400) + +def get_combined_details(request): + parent_company = request.GET.get('parent_company') + location = request.GET.get('location') + + # Fetch data from ClientDetails and SubcompanyDetails tables based on filters + client_details = ClientDetails.objects.filter(parent_company=parent_company, location=location) + subcompany_details = SubcompanyDetails.objects.filter(parent_company=parent_company, location=location) + + # Combine data from both tables + combined_data = [] + + # Add client details to combined_data + for detail in client_details: + combined_data.append({ + 'parent_company': detail.parent_company, + 'location': detail.location, + 'department': detail.department, + 'gst_no': detail.gst_no, + 'address': detail.address, + 'client_id': detail.client_id, + + }) + + # Add subcompany details to combined_data + for detail in subcompany_details: + combined_data.append({ + 'parent_company': detail.parent_company, + 'sub_company': detail.sub_company, + 'location': detail.location, + # 'department': detail.department, + 'gst_no': detail.gst_no, + 'address': detail.address, + 'client_id': detail.client_id, + + }) + print(combined_data) + return JsonResponse(combined_data, safe=False) + + +def get_locations(request): + print(0) + if request.method == 'GET' and 'parent_company' in request.GET: + print(1) + parent_company = request.GET.get('parent_company') + locations = SubcompanyDetails.objects.filter(parent_company=parent_company).values_list('location', flat=True) + serialized_data = json.dumps(list(locations), cls=DjangoJSONEncoder) + return JsonResponse(serialized_data, safe=False) + else: + return JsonResponse({'error': 'Invalid request'}) + + +def generate_client_id(parent_company): + # Extract first 4 letters from parent_company and convert to uppercase + prefix = parent_company[:4].upper() + # Generate 4 random integers + suffix = ''.join(random.choices(string.digits, k=4)) + # Concatenate prefix and suffix to form the client_id + client_id = prefix + suffix + return client_id + + +# def get_contacts(request): +# if request.method == 'GET': +# client = request.GET.get('Client') +# print(client) +# SPOC_Details = AddContact.objects.filter(Company=client).values('FirstName','Department') +# +# SPOC_Details_list = list(SPOC_Details) +# return JsonResponse(SPOC_Details_list, safe=False) +# else: +# return JsonResponse({'error': 'Invalid request'}) + + +def add_locations(request): + locations_list = ['Hyderabad', 'Pune', 'Chennai', 'Mumbai', 'Cochin', 'Ahmedabad', 'Bangalore'] + for location in locations_list: + try: + Locations.objects.get(location=location) + print(f"Location '{location}' already exists.") + except ObjectDoesNotExist: + Locations.objects.create(location=location) + print(f"Added location '{location}' to the database.") + + +def get_subclients(request): + if request.method == 'GET' and 'parent_company' in request.GET: + parent_company = request.GET['parent_company'] + # Query SubcompanyDetails table to filter sub-clients by parent company + sub_clients = SubcompanyDetails.objects.filter(parent_company=parent_company).values_list('sub_company', + flat=True) + # Convert queryset to list + sub_clients_list = list(sub_clients) + return JsonResponse(sub_clients_list, safe=False) + else: + return JsonResponse({'error': 'Invalid request'}) + + +def get_filtered_data(request): + if request.method == 'GET': + client = request.GET.get('client') + sub_client = request.GET.get('subClient') + + client_details = ClientDetails.objects.filter(parent_company=client) + client_id = [data.client_id for data in client_details] + print(client_id) + # Filter SubcompanyDetails based on client and sub-client + if sub_client == 'All Sub Clients': + sub_company_details = SubcompanyDetails.objects.filter(parent_company=client) + else: + sub_company_details = SubcompanyDetails.objects.filter(parent_company=client, sub_company=sub_client) + sub_client_id=[data.sub_client_id for data in sub_company_details] + print(sub_client_id) + + filtered_data = { + 'client_details':list(client_details.values()), + 'sub_company_details': list(sub_company_details.values()) + } + + # # Serialize the filtered data + serializer = DetailsSerializer(filtered_data) + print(serializer.data) + + return JsonResponse(serializer.data, safe=False) + else: + return JsonResponse({'error': 'Invalid request method'}, status=400) + +def save_new_entry(request): + if request.method == 'POST': + data = json.loads(request.body) + rowData = data.get('rowData') + department = data.get('department') + + # Retrieve the SubcompanyDetails instance based on the department + subcompany_instance = get_object_or_404(SubcompanyDetails, department=department) + + # Save the new contact data to the appropriate contact field + if subcompany_instance: + new_contact = Contact.objects.create(**rowData) + getattr(subcompany_instance, 'admin_contacts').add(new_contact) + return JsonResponse({'message': 'New entry saved successfully.'}, status=200) + else: + return JsonResponse({'message': f'No SubcompanyDetails instance found for department: {department}'}, status=404) + else: + return JsonResponse({'message': 'Invalid request method.'}, status=400) + +def add_contact(request): + print("00came") + if request.method == 'POST': + # Extract data from the form + Company = request.POST.get('Company', '') + Sub_company = request.POST.get('Sub_Company') or Company + LastName = request.POST.get('LastName', '') + FirstName = request.POST.get('FirstName', '') + Department = request.POST.get('Department', '') + Designation = request.POST.get('Designation', '') + Phone_number = request.POST.get('Phone_number', '') + Email = request.POST.get('Email', '') + + contact_id = generate_client_id(Company) + print(contact_id) + if not Company or not FirstName or not Department or not Designation or not Phone_number or not Email: + return JsonResponse({'status': 'error', 'message': 'Error while saving Sub_client.Please fill required fields'}, + status=400) + + # Save data into the database + add_contact = AddContact( + Company=Company, + Sub_company=Sub_company, + FirstName=FirstName, + LastName=LastName, + Department=Department, + Designation=Designation, + Phone_number=Phone_number, + Email=Email, + Contact_id=contact_id + ) + add_contact.save() + + admin_id = request.GET.get('admin_id', None) + print(admin_id) + + return JsonResponse({'status': 'success', 'message': 'Contact saved successfully.'}) + + else: + return JsonResponse({'status': 'error', 'message': 'Invalid request method'}, status=400) + +def validate_field(request): + if request.method == 'GET': + email = request.GET.get('Email') + phone_number = request.GET.get('Phone_number') + response = { + 'exists': False + } + if email and AddContact.objects.filter(Email=email).exists(): + response['exists'] = True + elif phone_number and AddContact.objects.filter(Phone_number=phone_number).exists(): + response['exists'] = True + return JsonResponse(response) + + +def validate_cell_field(request): + if request.method == 'GET': + email = request.GET.get('Email') + phone_number = request.GET.get('Phone_number') + contact_id = request.GET.get('Contact_id') + print('contact_id:',contact_id) + + response = { + 'email_exists': False, + 'phone_exists': False + } + if email: + existing_email_contact = AddContact.objects.filter(Email=email).first() + if existing_email_contact and existing_email_contact.Contact_id != contact_id: + response['email_exists'] = True + + # Check for existing phone number but ignore if it's the same contact + if phone_number: + existing_phone_contact = AddContact.objects.filter(Phone_number=phone_number).first() + if existing_phone_contact and existing_phone_contact.Contact_id != contact_id: + response['phone_exists'] = True + + return JsonResponse(response) + + + +# def save_job_posting(request): +# if request.method == 'POST': +# # Extract data from the form +# Client = request.POST.get('Client', '') +# JobID = request.POST.get('JobID', '') +# Location = request.POST.get('Location', '') +# SPOC = request.POST.get('SPOC', '') +# SPOC2 = request.POST.get('SPOC2', '') +# StartDate = request.POST.get('StartDate', '') +# CloseDate = request.POST.get('CloseDate', '') +# BudgetMin = request.POST.get('BudgetMin', '') +# BudgetMax = request.POST.get('BudgetMax', '') +# Header = request.POST.get('Header', '') +# JobDescription = request.POST.get('JobDescription', '') +# Experience_in_Yrs = request.POST.get('Experience_in_Yrs', '') +# NoOfPosting = request.POST.get('NoOfPosting', '') +# Type = request.POST.get('Type', '') +# SpecialInstructions = request.POST.get('SpecialInstructions', '') +# JD = request.POST.get('JD', '' ) +# +# jobposting = JobPosting( +# Client=Client, +# JobID=JobID, +# Location=Location, +# SPOC=SPOC, +# SPOC2=SPOC2, +# StartDate=StartDate, +# CloseDate=CloseDate, +# BudgetMin=BudgetMin, +# BudgetMax=BudgetMax, +# Header=Header, +# JobDescription=JobDescription, +# Experience_in_Yrs=Experience_in_Yrs, +# NoOfPosting=NoOfPosting, +# Type=Type, +# SpecialInstructions=SpecialInstructions, +# JD=JD, +# ) +# jobposting.save() +# print(jobposting) +# +# admin_id = request.GET.get('admin_id', None) +# print(admin_id) +# +# return JsonResponse({'status': 'success', 'message': 'Job_posting saved successfully.'}) +# +# else: +# return JsonResponse({'status': 'error', 'message': 'Invalid request method'}, status=400) + +def get_team_details(request): + if request.method == 'GET': + client = request.GET.get('client') + sub_client = request.GET.get('subClient') + + if not sub_client: + contacts = AddContact.objects.filter(Company=client, Sub_company='') + elif sub_client == 'All Sub Clients': + contacts = AddContact.objects.filter(Company=client) + else: + contacts = AddContact.objects.filter(Company=client, Sub_company=sub_client) + + filtered_data = { + 'contacts': list(contacts.values()), + } + # Return serialized data as JSON response + return JsonResponse(filtered_data, safe=False) + # return JsonResponse({"success": True, "message": "Contact added successfully."}) + + else: + return JsonResponse({'error': 'Invalid request method'}, status=400) + + +def get_department(request): + if request.method == 'GET': + department = request.GET.get('Department') + client = request.GET.get('client') + sub_client = request.GET.get('subClient') + + if not sub_client: + departments = AddContact.objects.filter(Department=department, Company=client, Sub_company='').distinct() + elif sub_client == 'All Sub Clients': + departments = AddContact.objects.filter(Department=department, Company=client).distinct() + else: + departments = AddContact.objects.filter(Department=department, Company=client, + Sub_company=sub_client).distinct() + # Convert queryset to list + department_list = list(departments.values()) + + return JsonResponse(department_list, safe=False) + # return JsonResponse({"success": True, "message": "Contact added successfully."}) + else: + return JsonResponse({'error': 'Invalid request method'}, status=400) + + +def get_SearchData(request): + if request.method == 'GET': + client = request.GET.get('client') + sub_client = request.GET.get('subClient') + searchKeyword = request.GET.get('searchKeyword') + + query1 = Q() + query2 = Q() + query3 = Q() + + if client: + query1 &= Q(Company__icontains=client) + query2 &= Q(parent_company__icontains=client) + query3 &= Q(parent_company__icontains=client) + + if sub_client and sub_client != 'All Sub Clients': + query1 &= Q(Sub_company__icontains=sub_client) + query2 &= Q(parent_company__icontains=sub_client) + query3 &= Q(sub_company__icontains=sub_client) + + if searchKeyword: + keywords = searchKeyword.split() + search_query1 = Q() + + search_query1 |= ( + Q(Sub_company__icontains=searchKeyword) | + Q(Company__icontains=searchKeyword) | + Q(FirstName__icontains=searchKeyword) | + Q(LastName__icontains=searchKeyword) | + Q(Designation__icontains=searchKeyword) | + Q(Department__icontains=searchKeyword) | + Q(Phone_number__icontains=searchKeyword) | + Q(Email__icontains=searchKeyword) + ) + + # Handle case for multiple words in keyword (e.g., "account department") + for word in keywords: + search_query1 |= ( + Q(Sub_company__icontains=word) | + Q(Company__icontains=word) | + Q(FirstName__icontains=word) | + Q(LastName__icontains=word) | + Q(Designation__icontains=word) | + Q(Department__icontains=word) | + Q(Phone_number__icontains=word) | + Q(Email__icontains=word) + ) + + # Handle concatenated names (e.g., "JohnDoe") + if len(keywords) == 1: # Check for single-word input + for i in range(1, len(searchKeyword)): + possible_first_name = searchKeyword[:i] + possible_last_name = searchKeyword[i:] + search_query1 |= ( + Q(FirstName__icontains=possible_first_name) & + Q(LastName__icontains=possible_last_name) + ) + elif len(keywords) == 2: # If two parts exist, treat as FirstName and LastName + first_name, last_name = keywords + search_query1 |= ( + Q(FirstName__icontains=first_name) & Q(LastName__icontains=last_name) + ) + + query1 &= search_query1 + + search_query2 = ( + Q(parent_company__icontains=searchKeyword) | Q(GST_No__icontains=searchKeyword) | + Q(location_Id__icontains=searchKeyword)) + query2 &= search_query2 + + search_query3 = ( + Q(sub_company__icontains=searchKeyword) | Q(parent_company__icontains=searchKeyword) | + Q(GST_No__icontains=searchKeyword) | Q(location_id__icontains=searchKeyword)) + query3 &= search_query3 + + contacts = AddContact.objects.filter(query1).values() + client_details = ClientDetails.objects.filter(query2).values() + sub_company_details = SubcompanyDetails.objects.filter(query3).values() + + filtered_data = { + 'contacts': list(contacts), + 'client_details': list(client_details), + 'sub_company_details': list(sub_company_details) + } + + return JsonResponse(filtered_data, safe=False) + else: + return JsonResponse({'error': 'Invalid request method'}, status=400) + + +def edit_CompanyDetails(request): + if request.method == 'POST': + try: + data = json.loads(request.body) + id = data.get('client_id') or data.get('sub_client_id') + print(id) + + if not id: + return JsonResponse({'error': 'ID parameter missing'}, status=400) + + if 'client_id' in data: + client = ClientDetails.objects.filter(client_id=id).first() + if client: + client.parent_company = data.get('parent_company', client.parent_company) + client.GST_No = data.get('GST_No', client.GST_No) + client.location_Id = data.get('location_Id', client.location_Id) + client.address_1 = data.get('address_1', client.address_1) + client.address_2 = data.get('address_2', client.address_2) + client.City = data.get('City', client.City) + client.state = data.get('state', client.state) + client.Pincode = data.get('Pincode', client.Pincode) + client.country = data.get('country', client.country) + client.save() + print(client) + return JsonResponse({'message': 'Client details updated successfully.'}, status=200) + + if 'sub_client_id' in data: + sub_client = SubcompanyDetails.objects.filter(sub_client_id=id).first() + if sub_client: + sub_client.parent_company = data.get('parent_company', sub_client.parent_company) + sub_client.sub_company = data.get('sub_company', sub_client.sub_company) + sub_client.GST_No = data.get('GST_No', sub_client.GST_No) + sub_client.location_id = data.get('location_id', sub_client.location_id) + sub_client.address_1 = data.get('address_1', sub_client.address_1) + sub_client.address_2 = data.get('address_2', sub_client.address_2) + sub_client.City = data.get('City', sub_client.City) + sub_client.State = data.get('State', sub_client.State) + sub_client.Pincode = data.get('Pincode', sub_client.Pincode) + sub_client.country = data.get('country', sub_client.country) + sub_client.save() + print(sub_client) + return JsonResponse({'message': 'Sub-client details updated successfully.'}, status=200) + + return JsonResponse({'error': 'Company details not found.'}, status=404) + + except json.JSONDecodeError: + return JsonResponse({'error': 'Invalid JSON'}, status=400) + except Exception as e: + return JsonResponse({'error': str(e)}, status=500) + + return JsonResponse({'error': 'Invalid request method'}, status=405) + + +def delete_CompanyDetails(request): + if request.method != 'DELETE': + return JsonResponse({'error': 'Invalid HTTP method. Only DELETE is allowed.'}, status=405) + + try: + data = json.loads(request.body) + client_id = data.get('client_id') + sub_client_id = data.get('sub_client_id') + parent_company = data.get('parent_company') + + if sub_client_id: + # Delete only the specific subclient + sub_clients_deleted, _ = SubcompanyDetails.objects.filter(sub_client_id=sub_client_id).delete() + response = { + 'message': 'Subclient deleted successfully.', + 'sub_clients_deleted': sub_clients_deleted + } + return JsonResponse(response, status=200) + + if client_id and parent_company: + # Delete related sub-clients and contacts + sub_clients_deleted, _ = SubcompanyDetails.objects.filter(parent_company=parent_company).delete() + contacts_deleted, _ = AddContact.objects.filter(Company=parent_company).delete() + + # Delete the main client + client = ClientDetails.objects.get(client_id=client_id, parent_company=parent_company) + client.delete() + + response = { + 'message': 'Client and related data deleted successfully.', + 'client_deleted': 1, + 'sub_clients_deleted': sub_clients_deleted, + 'contacts_deleted': contacts_deleted + } + return JsonResponse(response, status=200) + + return JsonResponse({'error': 'Insufficient data provided to delete any record.'}, status=400) + + except ClientDetails.DoesNotExist: + return JsonResponse({'error': 'Client with the given ID and Parent Company does not exist'}, status=404) + except Exception as e: + return JsonResponse({'error': f'An error occurred: {str(e)}'}, status=500) + + + +@csrf_exempt +def edit_teamDetails(request): + if request.method == 'POST': + data = json.loads(request.body) + id = data.get('Contact_id', None) + print(id) + + if id: + try: + contact = AddContact.objects.get(Contact_id=id) + print(contact) + + contact.Company = data.get('Company', contact.Company) + contact.Sub_company = data.get('Sub_company', contact.Sub_company) + contact.FirstName = data.get('FirstName', contact.FirstName) + contact.LastName = data.get('LastName', contact.LastName) + contact.Department = data.get('Department', contact.Department) + contact.Designation = data.get('Designation', contact.Designation) + contact.Phone_number = data.get('Phone_number', contact.Phone_number) + contact.Email = data.get('Email', contact.Email) + contact.save() + print(contact) + return JsonResponse({'message': 'Contact updated successfully.'}, status=200) + except AddContact.DoesNotExist: + return JsonResponse({'error': 'Contact not found.'}, status=404) + except Exception as e: + return JsonResponse({'error': str(e)}, status=500) + else: + return JsonResponse({'error': 'Email not provided.'}, status=400) + else: + return JsonResponse({'error': 'Invalid request method.'}, status=405) + + +def delete_teamDetails(request): + try: + # Get the contact_id from the query parameters instead of the request body + contact_id = request.GET.get('Contact_id') + print('contact_id:', contact_id) + + if contact_id is None: + return JsonResponse({'error': 'Contact ID not provided'}, status=400) + + # Try to get the contact and delete it + contact = AddContact.objects.get(Contact_id=contact_id) + contact.delete() + + return JsonResponse({'success': f'Contact with id {contact_id} deleted successfully'}) + + except AddContact.DoesNotExist: + return JsonResponse({'error': 'Contact does not exist'}, status=404) + + except Exception as e: + # Log the error and return a 500 status + print(f'Error deleting contact: {e}') + return JsonResponse({'error': str(e)}, status=500) + + +def edit_internalTeam(request): + if request.method == 'POST': + data = json.loads(request.body) + email = data.get('Email1', None) + print(email) + + if email: + try: + employee = InternalTeam.objects.get(Email1=email) + + employee.FirstName = data.get('FirstName', employee.FirstName) + employee.LastName = data.get('LastName', employee.LastName) + employee.Designation = data.get('Designation', employee.Designation) + employee.Department = data.get('Department', employee.Department) + employee.PhoneNo1 = data.get('PhoneNo1', employee.PhoneNo1) + employee.LandNumber = data.get('LandNumber', employee.LandNumber) + employee.Email2 = data.get('Email2', employee.Email2) + employee.Level = data.get('Level', employee.Level) + employee.save() + print(employee) + return JsonResponse({'message': 'Internal Team updated successfully.'}, status=200) + except AddContact.DoesNotExist: + return JsonResponse({'error': 'Contact not found.'}, status=404) + except Exception as e: + return JsonResponse({'error': str(e)}, status=500) + else: + return JsonResponse({'error': 'Email not provided.'}, status=400) + else: + return JsonResponse({'error': 'Invalid request method.'}, status=405) + + +def delete_internalTeam(request): + try: + email = request.GET.get('Email1') + print(email) + + employee = InternalTeam.objects.get(Email1=email) + print(employee) + employee.delete() + return JsonResponse({'success':f'Data with Email {email} deleted successfully'}) + except InternalTeam.DoesNotExist: + return JsonResponse({'error': 'Employee does not exist'}, status=404) + + except Exception as e: + # Log the error and return a 500 status + print(f'Error deleting Internal Team Details: {e}') + return JsonResponse({'error': str(e)}, status=500) + + +def print_internalTeam(request): + email = request.GET.get('Email1') + print(email) + + if email: + try: + employee = InternalTeam.objects.get(Email1=email) + + data = { + 'FirstName': employee.FirstName, + 'LastName': employee.LastName, + 'Designation': employee.Designation, + 'Department': employee.Department, + 'PhoneNo1': employee.PhoneNo1, + 'LandNumber': employee.LandNumber, + 'Email1': employee.Email1, + 'Email2': employee.Email2, + 'Level': employee.Level + } + print(employee) + return JsonResponse(data, status=200) + except AddContact.DoesNotExist: + return JsonResponse({'error': 'Contact not found.'}, status=404) + except Exception as e: + return JsonResponse({'error': str(e)}, status=500) + else: + return JsonResponse({'error': 'Email not provided.'}, status=400) + + +def validate_existingEmployee(request): + if request.method == 'GET': + email1 = request.GET.get('Email1') + email2 = request.GET.get('Email2') + phone_number1 = request.GET.get('PhoneNo1') + phone_number2 = request.GET.get('PhoneNo2') + + response = { + 'email_exists': False, + 'phone_exists': False, + + } + if email2: + existing_phone_contact1 = InternalTeam.objects.filter(Email1=email2).first() + existing_phone_contact2 = InternalTeam.objects.filter(Email2=email2).first() + if (existing_phone_contact1 and existing_phone_contact1.Email1 != email1) or \ + (existing_phone_contact2 and existing_phone_contact2.Email1 != email1): + response['email_exists'] = True + + # Check for existing phone number but ignore if it's the same contact + if phone_number1: + existing_phone_contact1 = InternalTeam.objects.filter(PhoneNo1=phone_number1).first() + existing_phone_contact2 = InternalTeam.objects.filter(LandNumber=phone_number1).first() + if (existing_phone_contact1 and existing_phone_contact1.Email1 != email1) or \ + (existing_phone_contact2 and existing_phone_contact2.Email1 != email1): + response['phone_exists'] = True + + if phone_number2: + existing_phone_contact1 = InternalTeam.objects.filter(PhoneNo1=phone_number2).first() + existing_phone_contact2 = InternalTeam.objects.filter(LandNumber=phone_number2).first() + if (existing_phone_contact1 and existing_phone_contact1.Email1 != email1) or \ + (existing_phone_contact2 and existing_phone_contact2.Email1 != email1): + response['phone_exists'] = True + + return JsonResponse(response) + + + +def Internal_team_details(request): + admin_id = request.GET.get('admin_id', None) + print(admin_id) + return render(request, 'skyonnadmin/Internal_team_details.html',{'admin_id': admin_id}) + + +def save_Internal_team_Details(request): + if request.method == 'POST': + FirstName = request.POST.get('FirstName').strip() + LastName = request.POST.get('LastName') + Designation = request.POST.get('Designation') + Department = request.POST.get('Department') + Address_1 = request.POST.get('Address_1') + Address_2 = request.POST.get('Address_2') + City = request.POST.get('City') + State = request.POST.get('State') + Country = request.POST.get('Country') + Pincode = request.POST.get('Pincode') + PhoneNo1 = request.POST.get('PhoneNo1') + LandNumber = request.POST.get('LandNumber') + Email1 = request.POST.get('Email1') + Email2 = request.POST.get('Email2') + Level = request.POST.get('Level') + + Login = Email1 + Password = FirstName + '@123' + user_id = FirstName.upper()[:3] + PhoneNo1[:4] + + internal_team = InternalTeam( + FirstName=FirstName, + LastName=LastName, + Designation=Designation, + Department=Department, + Address_1=Address_1, + Address_2=Address_2, + City=City, + State=State, + Pincode=Pincode, + Country=Country, + PhoneNo1=PhoneNo1, + LandNumber=LandNumber, + Email1=Email1, + Email2=Email2, + Level=Level, + Login=Login, + Password=Password, + user_id=user_id + ) + internal_team.save() + + # email_thread= threading.Thread(target=send_login_credentials, args=(FirstName, Login, Password, Email1)) + # email_thread.start() + + # Return JSON response + return JsonResponse({'status': 'success', 'message': 'Internal team details saved successfully.'}) + else: + return HttpResponse('Invalid request method', status=405) + +# def send_login_credentials(FirstName, Login, Password, Email1): +# subject = 'Your Login Credentials' +# message = f'Hi {FirstName}, \n\n Your Login Credentials are: \n Login_id : {Login} \n Password : {Password}' +# from_email = 'subramanyajithendra@gmail.com' +# recipient_list = [Email1] +# send_mail(subject, message, from_email, recipient_list) + + +def validate_internal_team(request): + if request.method == 'GET': + email1 = request.GET.get('Email1') + email2 = request.GET.get('Email2') + phone_number1 = request.GET.get('PhoneNo1') + phone_number2 = request.GET.get('LandNumber') + response = { + 'exists': False + } + if email1 and (InternalTeam.objects.filter(Email1=email1).exists() or InternalTeam.objects.filter(Email2=email1).exists()): + response['exists'] = True + if email2 and (InternalTeam.objects.filter(Email1=email2).exists() or InternalTeam.objects.filter(Email2=email2).exists()): + response['exists'] = True + if phone_number1 and (InternalTeam.objects.filter(PhoneNo1=phone_number1).exists() or InternalTeam.objects.filter(LandNumber=phone_number1).exists()): + response['exists'] = True + elif phone_number2 and (InternalTeam.objects.filter(PhoneNo1=phone_number2).exists() or InternalTeam.objects.filter(LandNumber=phone_number2).exists()): + response['exists'] = True + return JsonResponse(response) + + +# def existing_employee(request): +# employees = InternalTeam.objects.all() +# +# employees_data = [] +# for employee in employees: +# employees_data.append({ +# 'FirstName': employee.FirstName, +# 'LastName': employee.LastName, +# 'Designation': employee.Designation, +# 'Department': employee.Department, +# 'Address_1': employee.Address_1, +# 'Address_2': employee.Address_2, +# 'City': employee.City, +# 'State': employee.State, +# 'Pincode': employee.Pincode, +# 'Country': employee.Country, +# 'PhoneNo1': employee.PhoneNo1, +# 'PhoneNo2': employee.PhoneNo2, +# 'Email1': employee.Email1, +# 'Email2': employee.Email2, +# 'Band': employee.Band +# }) +# +# return JsonResponse({'employees': employees_data}) + + +def get_row_count(request): + if request.method == 'POST' and request.FILES['excelFile']: + try: + excel_file = request.FILES['excelFile'] + df = pd.read_excel(excel_file) # Requires pandas and openpyxl + row_count = len(df.index) # Count the rows in the DataFrame + return JsonResponse({'row_count': row_count}) + except Exception as e: + return JsonResponse({'error': str(e)}, status=400) + return JsonResponse({'error': 'Invalid request'}, status=400) + +def load_excel_data(request): + if request.method == 'POST' and request.FILES.get('excelFile'): + excel_file = request.FILES['excelFile'] + data = pd.read_excel(excel_file) + + required_columns = ['FirstName', 'LastName', 'Designation', 'Department', 'Address_1', 'City', + 'State', 'Pincode', 'Country', 'PhoneNo1','LandNumber', 'Email1', 'Level'] + + data[['PhoneNo1', 'LandNumber']] = data[['PhoneNo1', 'LandNumber']].fillna('') + + empty_fields = {} + + for column in required_columns: + if column not in ['PhoneNo1','LandNumber'] and data[column].isnull().any(): + empty_fields[column] = data[data[column].isnull()].index.tolist() + + missing_contact = data[(data['PhoneNo1'] == '') & (data['LandNumber'] == '')].index.tolist() + + if missing_contact: + empty_fields['Contact'] = missing_contact + + if empty_fields: + return JsonResponse({'error': True, + 'message': 'Some fields are empty in the provided Excel sheet.','empty_fields': empty_fields}, status=400) + + valid_data = data[(data['PhoneNo1'] != '') | (data['LandNumber'] != '')] + print(valid_data) + + return JsonResponse({'error': False,'data': valid_data.to_dict(orient='records')}, safe=False) + + return JsonResponse({'error': True,'message': "No file uploaded"}, status=400) + + +def process_row(request): + if request.method == 'POST': + try: + row_data = json.load(request.body) + print(row_data) + + FirstName = row_data.get('FirstName') + LastName = row_data.get('LastName') + Designation = row_data.get('Designation') + Department = row_data.get('Department') + Address_1 = row_data.get('Address_1') + Address_2 = row_data.get('Address_2') + City = row_data.get('City') + State = row_data.get('State') + Pincode = row_data.get('Pincode') + PhoneNo1 = row_data.get('PhoneNo1') + LandNumber = row_data.get('LandNumber') + Email1 = row_data.get('Email1') + Email2 = row_data.get('Email2') + Level = row_data.get('Level') + + return JsonResponse({"message": "Row processed successfully", "data": row_data}, status=200) + + except Exception as e: + return JsonResponse({"error": f"Failed to process row: {str(e)}"}, status=400) + + return JsonResponse({"error": "Invalid request method"}, status=400) + + +def existing_employee(request): + employees = InternalTeam.objects.all() + + employees_data = [] + for employee in employees: + employees_data.append({ + 'FirstName': employee.FirstName, + 'LastName': employee.LastName, + 'Designation': employee.Designation, + 'Department': employee.Department, + 'PhoneNo1': employee.PhoneNo1, + 'LandNumber': employee.LandNumber, + 'Email1': employee.Email1, + 'Email2': employee.Email2, + 'Level': employee.Level + }) + + return JsonResponse({'employees': employees_data}) + +def get_employee(request): + if request.method == 'GET': + firstName = request.GET.get('firstName') + lastName = request.GET.get('lastName') + email = request.GET.get('Email1') + print('email:',email) + try: + + emp_obj = InternalTeam.objects.filter((Q(FirstName=firstName) | Q(LastName=lastName)) & Q(Email1=email)).first() + emp_data = { + 'FirstName': emp_obj.FirstName, + 'LastName': emp_obj.LastName, + 'Designation': emp_obj.Designation, + 'Department': emp_obj.Department, + 'Address_1': emp_obj.Address_1, + 'Address_2': emp_obj.Address_2, + 'City': emp_obj.City, + 'State': emp_obj.State, + 'Pincode': emp_obj.Pincode, + 'Country': emp_obj.Country, + 'PhoneNo1': emp_obj.PhoneNo1, + 'LandNumber': emp_obj.LandNumber, + 'Email1': emp_obj.Email1, + 'Email2': emp_obj.Email2, + 'Level': emp_obj.Level, + } + return JsonResponse(emp_data) + except InternalTeam.DoesNotExist: + return JsonResponse({'error': 'Client not found'}, status=404) + else: + return JsonResponse({'error': 'Invalid request method'}, status=400) diff --git a/skyonnweb/skyonnweb/__init__.py b/skyonnweb/skyonnweb/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/skyonnweb/skyonnweb/asgi.py b/skyonnweb/skyonnweb/asgi.py new file mode 100644 index 0000000..2ee8d66 --- /dev/null +++ b/skyonnweb/skyonnweb/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for skyonnweb project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'skyonnweb.settings') + +application = get_asgi_application() diff --git a/skyonnweb/skyonnweb/settings.py b/skyonnweb/skyonnweb/settings.py new file mode 100644 index 0000000..7618e12 --- /dev/null +++ b/skyonnweb/skyonnweb/settings.py @@ -0,0 +1,179 @@ +""" +Django settings for skyonnweb project ishu. + +Generated by 'django-admin startproject' using Django 4.2.11. + +For more information on this file, see +https://docs.djangoproject.com/en/4.2/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.2/ref/settings/ +""" +import os +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-r*y737z-@#o&lm&hfylvv4*h$8c_288g2m_y=e3gz%_-ig!i^_' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'skyonnadmin', + 'user', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'skyonnweb.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [os.path.join(BASE_DIR, 'templates')], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + 'django.template.context_processors.media', + ], + }, + }, +] +WSGI_APPLICATION = 'skyonnweb.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/4.2/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', + 'NAME': 'skyonn4', + 'USER': 'root', + 'PASSWORD': '', + 'HOST': 'localhost', + 'PORT': '3306', + 'OPTIONS': { + 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", + }, + } +} + + +# Password validation +# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/4.2/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/4.2/howto/static-files/ + +STATIC_URL = 'static/' + +# STATICFILES_DIRS = [ +# BASE_DIR / "static", +# ] +STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')] + +MEDIA_URL = '/media/' +MEDIA_ROOT = os.path.join(BASE_DIR,'media') + +# Default primary key field type +# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' + +AUTHENTICATION_BACKENDS = [ + 'user.backend.PhoneAuthenticationBackend', + 'django.contrib.auth.backends.ModelBackend', # Keep the default backend as a fallback +] + +EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' #settings to send mail +EMAIL_HOST = 'smtp.gmail.com' # Replace with your SMTP server +EMAIL_PORT = 587 +EMAIL_USE_TLS = True +EMAIL_HOST_USER = 'subramanyajithendra@gmail.com' +EMAIL_HOST_PASSWORD = 'grdwevagtfmfqosb' + +TIME_ZONE = 'Asia/Kolkata' +USE_TZ = True + +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'handlers': { + 'file': { + 'level': 'ERROR', + 'class': 'logging.FileHandler', + 'filename': '/home/armintacareers/arminta-web/skyonnweb/logs/django.log', + }, + }, + 'loggers': { + 'django': { + 'handlers': ['file'], + 'level': 'ERROR', + 'propagate': True, + }, + }, +} + + + + diff --git a/skyonnweb/skyonnweb/urls.py b/skyonnweb/skyonnweb/urls.py new file mode 100644 index 0000000..a81a03b --- /dev/null +++ b/skyonnweb/skyonnweb/urls.py @@ -0,0 +1,13 @@ +from django.contrib import admin +from django.urls import path +from django.contrib import admin +from django.urls import path, include # Make sure to import include here +from django.conf import settings +from django.conf.urls.static import static + +urlpatterns = [ + path('admin/', admin.site.urls), + path('skyonnadmin/', include('skyonnadmin.urls')), + path('', include('user.urls')), # Include your users app URLs + +] + static(settings.MEDIA_URL,document_root = settings.MEDIA_ROOT) diff --git a/skyonnweb/skyonnweb/wsgi.py b/skyonnweb/skyonnweb/wsgi.py new file mode 100644 index 0000000..e2c4e98 --- /dev/null +++ b/skyonnweb/skyonnweb/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for skyonnweb project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'skyonnweb.settings') + +application = get_wsgi_application() diff --git a/skyonnweb/static/images/Activity Report.svg b/skyonnweb/static/images/Activity Report.svg new file mode 100644 index 0000000..62df0fb --- /dev/null +++ b/skyonnweb/static/images/Activity Report.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/skyonnweb/static/images/Add A New SPOC.svg b/skyonnweb/static/images/Add A New SPOC.svg new file mode 100644 index 0000000..8b9150a --- /dev/null +++ b/skyonnweb/static/images/Add A New SPOC.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/skyonnweb/static/images/All job post.svg b/skyonnweb/static/images/All job post.svg new file mode 100644 index 0000000..928a777 --- /dev/null +++ b/skyonnweb/static/images/All job post.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/skyonnweb/static/images/Arminta_Logo.svg b/skyonnweb/static/images/Arminta_Logo.svg new file mode 100644 index 0000000..1ba0472 --- /dev/null +++ b/skyonnweb/static/images/Arminta_Logo.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/skyonnweb/static/images/Arminta_Logo_1.svg b/skyonnweb/static/images/Arminta_Logo_1.svg new file mode 100644 index 0000000..9b78446 --- /dev/null +++ b/skyonnweb/static/images/Arminta_Logo_1.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/skyonnweb/static/images/Client Details (3).svg b/skyonnweb/static/images/Client Details (3).svg new file mode 100644 index 0000000..ebaed3a --- /dev/null +++ b/skyonnweb/static/images/Client Details (3).svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/skyonnweb/static/images/Close_Button.svg b/skyonnweb/static/images/Close_Button.svg new file mode 100644 index 0000000..29b81cf --- /dev/null +++ b/skyonnweb/static/images/Close_Button.svg @@ -0,0 +1,4 @@ + + + + diff --git a/skyonnweb/static/images/Internal team Details (1).svg b/skyonnweb/static/images/Internal team Details (1).svg new file mode 100644 index 0000000..76ebf38 --- /dev/null +++ b/skyonnweb/static/images/Internal team Details (1).svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/skyonnweb/static/images/Messages.svg b/skyonnweb/static/images/Messages.svg new file mode 100644 index 0000000..243aed0 --- /dev/null +++ b/skyonnweb/static/images/Messages.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/skyonnweb/static/images/New job post (1).svg b/skyonnweb/static/images/New job post (1).svg new file mode 100644 index 0000000..9fa7a38 --- /dev/null +++ b/skyonnweb/static/images/New job post (1).svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/skyonnweb/static/images/Pending process.svg b/skyonnweb/static/images/Pending process.svg new file mode 100644 index 0000000..28df225 --- /dev/null +++ b/skyonnweb/static/images/Pending process.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/skyonnweb/static/images/Save_Button (1).svg b/skyonnweb/static/images/Save_Button (1).svg new file mode 100644 index 0000000..56cfa33 --- /dev/null +++ b/skyonnweb/static/images/Save_Button (1).svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/skyonnweb/static/images/logo (2).png b/skyonnweb/static/images/logo (2).png new file mode 100644 index 0000000..f7f2c02 Binary files /dev/null and b/skyonnweb/static/images/logo (2).png differ diff --git a/skyonnweb/static/images/submited Resumes.svg b/skyonnweb/static/images/submited Resumes.svg new file mode 100644 index 0000000..79e7dc6 --- /dev/null +++ b/skyonnweb/static/images/submited Resumes.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/skyonnweb/templates/recruiter/recruiter_dashboard.html b/skyonnweb/templates/recruiter/recruiter_dashboard.html new file mode 100644 index 0000000..92b8ded --- /dev/null +++ b/skyonnweb/templates/recruiter/recruiter_dashboard.html @@ -0,0 +1 @@ +

hiiiiiii {{first_name}}

\ No newline at end of file diff --git a/skyonnweb/templates/skyonnadmin/Internal_team_details.html b/skyonnweb/templates/skyonnadmin/Internal_team_details.html new file mode 100644 index 0000000..9a3864e --- /dev/null +++ b/skyonnweb/templates/skyonnadmin/Internal_team_details.html @@ -0,0 +1,405 @@ + + + + + + + New Job Posting + + + + + +
+
+ + Skyonn Technologies: +   Internal Team_Details + +
+ + + + + + + diff --git a/skyonnweb/templates/skyonnadmin/add_client.html b/skyonnweb/templates/skyonnadmin/add_client.html new file mode 100644 index 0000000..ef5a19e --- /dev/null +++ b/skyonnweb/templates/skyonnadmin/add_client.html @@ -0,0 +1,440 @@ + + + + + + + New Job Posting + + + + + +
+
+
+ {% csrf_token %} +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+ + + + + +
+ +
+
+
+ + + \ No newline at end of file diff --git a/skyonnweb/templates/skyonnadmin/add_new_contact.html b/skyonnweb/templates/skyonnadmin/add_new_contact.html new file mode 100644 index 0000000..7837230 --- /dev/null +++ b/skyonnweb/templates/skyonnadmin/add_new_contact.html @@ -0,0 +1,239 @@ + + + + + + SubClient Form + + + +
+
+
+ {% csrf_token %} +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+
+
+ + + diff --git a/skyonnweb/templates/skyonnadmin/add_subclient.html b/skyonnweb/templates/skyonnadmin/add_subclient.html new file mode 100644 index 0000000..402607d --- /dev/null +++ b/skyonnweb/templates/skyonnadmin/add_subclient.html @@ -0,0 +1,314 @@ + + + + + + Document + + + +
+
+
+ {% csrf_token %} +
+
+
+ + +
+ +
+ + + +
+ +
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
+ + +
+ + +
+
+ + +
+
+ + +
+ +
+ + +
+ +
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/skyonnweb/templates/skyonnadmin/admin_dashboard.html b/skyonnweb/templates/skyonnadmin/admin_dashboard.html new file mode 100644 index 0000000..cafd726 --- /dev/null +++ b/skyonnweb/templates/skyonnadmin/admin_dashboard.html @@ -0,0 +1,4818 @@ + + + + + + + + + + + + + Admin Dashboard + + +
+ +
+ {% load static %} + + +
  • + +
  • +
  • + + +
  • +
    + + + +

    Skyonn Technologies

    +
    +
    + +
    +
    +
    +
    + {% if picture %} + Profile Picture + {% endif %} +
    +
    +
    + +

    {{first_name}}

    +LogOut +
    +
    + + +
    + +
    + +
    + +
    + + \ No newline at end of file diff --git a/skyonnweb/templates/skyonnadmin/client_details.html b/skyonnweb/templates/skyonnadmin/client_details.html new file mode 100644 index 0000000..656f898 --- /dev/null +++ b/skyonnweb/templates/skyonnadmin/client_details.html @@ -0,0 +1,399 @@ + + + + + + Client Details + + + + +

    Client Details

    +
    Client Details
    + +
    Existing Client
    +
    Add New Client
    +
    Add Sub Clients/Locations
    + +
    +

    Existing Client

    +
    + + + + + + + +
    + +
    + +
    +

    Add New Client

    +
    + {% csrf_token %} +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +

    Admin Department Contact person Name for the Above office location*

    +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    +
    + +
    +

    Add Sub Clients/Locations

    +
    + {% csrf_token %} +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +

    Department Contact person Name for the Above office location*

    +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    +
    + + + + diff --git a/skyonnweb/templates/skyonnadmin/existing_client.html b/skyonnweb/templates/skyonnadmin/existing_client.html new file mode 100644 index 0000000..23226c3 --- /dev/null +++ b/skyonnweb/templates/skyonnadmin/existing_client.html @@ -0,0 +1,200 @@ + + + + + + + New Job Posting + + + + + +
    +
    +
    +
    + {% csrf_token %} + + + + + + + +


    +
    + + +
    +
    +
    + +
    +
    +
    +
    + + + diff --git a/skyonnweb/templates/skyonnadmin/home.html b/skyonnweb/templates/skyonnadmin/home.html new file mode 100644 index 0000000..abc3be1 --- /dev/null +++ b/skyonnweb/templates/skyonnadmin/home.html @@ -0,0 +1,564 @@ + + + + + Skyonn Admin Portal + + + + +
    +

    Skyonn Admin Portal

    + +
    +
    + {% csrf_token %} +
    + +
    +
    + +
    + +
    + +
    +

    New user? Sign Up

    +
    +
    + + +
    + + + diff --git a/skyonnweb/templates/skyonnadmin/new_job_posting.html b/skyonnweb/templates/skyonnadmin/new_job_posting.html new file mode 100644 index 0000000..38ac6ce --- /dev/null +++ b/skyonnweb/templates/skyonnadmin/new_job_posting.html @@ -0,0 +1,729 @@ + + + + + + + New Job Posting + + + +
    +
    + {% csrf_token %} + +
    +
    +
    +
    + + +
    + + + +
    + + +
    + +
    + + +
    + +
    + + +
    +
    + + + +
    + +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    + + +
    +
    +
    + + +
    + + + + +
    + + +
    + +
    + + +
    + +
    +
    +
    +
    + +
    +
    + + + +
    +
    +
    + Budget Max must be greater than Budget Min. +
    + + + + + + + + + + + \ No newline at end of file diff --git a/skyonnweb/templates/skyonnadmin/test.html b/skyonnweb/templates/skyonnadmin/test.html new file mode 100644 index 0000000..8c9e50d --- /dev/null +++ b/skyonnweb/templates/skyonnadmin/test.html @@ -0,0 +1,224 @@ + + + + + + + + + + + Admin Dashboard + + +
    +

    Home

    +

    Admin Dashboard

    +
    + +
    +
    + +
    +
    + +
    +

    Laxmi

    + LogOut +
    +
    + + + + +
    + + diff --git a/skyonnweb/templates/user/Messages.html b/skyonnweb/templates/user/Messages.html new file mode 100644 index 0000000..c296134 --- /dev/null +++ b/skyonnweb/templates/user/Messages.html @@ -0,0 +1,167 @@ + + + + + + Document + + + + +
    + +
    +
    + search + +
    +
    + apps + notifications + account_circle +
    +
    + +
    + +
    + +
    +
    +
    + inbox +

    Inbox

    +
    + +
    + near_me +

    Sent

    +
    + +
    + delete +

    Trash

    +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/skyonnweb/templates/user/add_recruiter.html b/skyonnweb/templates/user/add_recruiter.html new file mode 100644 index 0000000..814c124 --- /dev/null +++ b/skyonnweb/templates/user/add_recruiter.html @@ -0,0 +1,218 @@ + + + + + + + Sign Up Page + + + +
    +

    Add Recruiter

    +
    +
    + {% csrf_token %} +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    + +
    + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + + + + + \ No newline at end of file diff --git a/skyonnweb/templates/user/all_job_postings.html b/skyonnweb/templates/user/all_job_postings.html new file mode 100644 index 0000000..652fff8 --- /dev/null +++ b/skyonnweb/templates/user/all_job_postings.html @@ -0,0 +1,214 @@ + + + + + + + Job/Project Table + + + + + + +
    +
    +
    +

    All Job Posting

    +
    +
    + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + {% for posting in job_postings %} + + + + + + + + + + + + {% endfor %} +
    ClientJobIdHeaderSPOCNo of PostingsStart DateBudget Max RsLocationJD
    {{ posting.Client }}{{ posting.JobID }}{{ posting.Header }}{{ posting.SPOC }}{{ posting.NoOfPosting }}{{ posting.StartDate }}{{ posting.maxAmount }}{{ posting.Location }}{{ posting.slice_JD }}
    + +
    + + + + + +
    +
    + + + diff --git a/skyonnweb/templates/user/dashboard.html b/skyonnweb/templates/user/dashboard.html new file mode 100644 index 0000000..d9e8a49 --- /dev/null +++ b/skyonnweb/templates/user/dashboard.html @@ -0,0 +1,1494 @@ + + + + + + + + + + + Dashboard + + +
    + +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + + +
    + +
    + + + + + + + + +
    + + + + \ No newline at end of file diff --git a/skyonnweb/templates/user/form.html b/skyonnweb/templates/user/form.html new file mode 100644 index 0000000..8d82a77 --- /dev/null +++ b/skyonnweb/templates/user/form.html @@ -0,0 +1,144 @@ + + + + + Title + + + +
    +
    +

    Job application + (Web) + +

    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/skyonnweb/templates/user/home.html b/skyonnweb/templates/user/home.html new file mode 100644 index 0000000..91f8237 --- /dev/null +++ b/skyonnweb/templates/user/home.html @@ -0,0 +1,312 @@ + + + + + Skyonn Recruiting Portal + + + + +
    +

    Skyonn Recruiting Portal

    + +
    +
    + {% csrf_token %} +
    + +
    +
    + + +
    + +
    +
    +

    New user? Sign Up

    +
    +
    + + +
    + + + diff --git a/skyonnweb/templates/user/hyperlink.html b/skyonnweb/templates/user/hyperlink.html new file mode 100644 index 0000000..eb301a4 --- /dev/null +++ b/skyonnweb/templates/user/hyperlink.html @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/skyonnweb/templates/user/message_detail.html b/skyonnweb/templates/user/message_detail.html new file mode 100644 index 0000000..34308bb --- /dev/null +++ b/skyonnweb/templates/user/message_detail.html @@ -0,0 +1,84 @@ + + + + + + Message Detail + + + + +
    + {% block content %} + {% if user.is_authenticated %} +
    +
    +

    {{ message.subject }}

    +
    +
    +
    + {{ message.sender.first_name }} + From: {{ message.sender.first_name }} {{ message.sender.last_name }} +
    +
    + To: + {% for receiver in message.receivers.all %} + {{ receiver.first_name }} + {{ receiver.first_name }} {{ receiver.last_name }}{% if not forloop.last %}, {% endif %} + {% endfor %} +
    +
    +

    {{ message.body }}

    + {% if message.attachment %} +

    Attachment: {{ message.attachment.name }}

    + {% endif %} +
    +
    +
    +

    Replies

    + +

    Add a Reply

    +
    + {% csrf_token %} + {{ form.as_p }} + +
    + {% else %} +

    Please log in to view this message.

    + {% endif %} + {% endblock %} +
    + + + + + diff --git a/skyonnweb/templates/user/message_list.html b/skyonnweb/templates/user/message_list.html new file mode 100644 index 0000000..c3bb773 --- /dev/null +++ b/skyonnweb/templates/user/message_list.html @@ -0,0 +1,75 @@ + + + + + + Messages + + + + +
    + {% if user.is_authenticated %} +
    +
    +

    Messages

    +
    +
    +
      + {% for message in messages %} +
    • +
      +
      + {{ message.subject }} +

      + + From: + {% if message.sender.picture %} + Profile Picture + {% endif %} + {{ message.sender.first_name }} {{ message.sender.last_name }} + +

      +

      + + To: + {% for receiver in message.receivers.all %} + {% if receiver.picture %} + Profile Picture + {% endif %} + {{ receiver.first_name }} {{ receiver.last_name }}{% if not forloop.last %}, {% endif %} + {% endfor %} + +

      +
      + {{ message.timestamp|date:"M d, Y h:i A" }} +
      +
    • + {% endfor %} +
    +
    +
    + + {% else %} +

    Please log in to see your messages.

    + {% endif %} +
    + + + + + diff --git a/skyonnweb/templates/user/new_job_posting.html b/skyonnweb/templates/user/new_job_posting.html new file mode 100644 index 0000000..c29f5e4 --- /dev/null +++ b/skyonnweb/templates/user/new_job_posting.html @@ -0,0 +1,617 @@ + + + + + + + New Job Posting + + + + +
    + +
    + NewJobPosting +
    + {% csrf_token %} + + +
    +
    + +
    +
    + + +
    + + + +
    + + +
    + +
    + + +
    + +
    + + +
    +
    + + + +
    + +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    + + + + +
    + + +
    + +
    +
    + + +
    + + + + +
    + + +
    + + + + + + +
    +
    +
    +
    + +
    + + +
    + + + + + + +

    +
    +
    +
    + Budget Max must be greater than Budget Min. +
    + + + + + + + + +
    + + diff --git a/skyonnweb/templates/user/new_message.html b/skyonnweb/templates/user/new_message.html new file mode 100644 index 0000000..ebd4de0 --- /dev/null +++ b/skyonnweb/templates/user/new_message.html @@ -0,0 +1,9 @@ + +{% block content %} +

    New Message

    +
    + {% csrf_token %} + {{ form.as_p }} + +
    +{% endblock %} diff --git a/skyonnweb/templates/user/success_url.html b/skyonnweb/templates/user/success_url.html new file mode 100644 index 0000000..9630c45 --- /dev/null +++ b/skyonnweb/templates/user/success_url.html @@ -0,0 +1 @@ +

    success

    \ No newline at end of file diff --git a/skyonnweb/templates/user/test.html b/skyonnweb/templates/user/test.html new file mode 100644 index 0000000..44a266f --- /dev/null +++ b/skyonnweb/templates/user/test.html @@ -0,0 +1,397 @@ + + + + + + + + + + + Dashboard + + +
    + +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + + + \ No newline at end of file diff --git a/skyonnweb/user/__init__.py b/skyonnweb/user/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/skyonnweb/user/admin.py b/skyonnweb/user/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/skyonnweb/user/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/skyonnweb/user/apps.py b/skyonnweb/user/apps.py new file mode 100644 index 0000000..36cce4c --- /dev/null +++ b/skyonnweb/user/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class UserConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'user' diff --git a/skyonnweb/user/backend.py b/skyonnweb/user/backend.py new file mode 100644 index 0000000..b19887a --- /dev/null +++ b/skyonnweb/user/backend.py @@ -0,0 +1,15 @@ +from django.contrib.auth.backends import ModelBackend +from django.core.exceptions import MultipleObjectsReturned +from .models import CustomUser + + +class PhoneAuthenticationBackend(ModelBackend): + def authenticate(self, request, phone=None, password=None, **kwargs): + try: + user = CustomUser.objects.get(phone=phone) + if user.check_password(password): + return user + except CustomUser.DoesNotExist: + return None + except MultipleObjectsReturned: + return None diff --git a/skyonnweb/user/forms.py b/skyonnweb/user/forms.py new file mode 100644 index 0000000..874615d --- /dev/null +++ b/skyonnweb/user/forms.py @@ -0,0 +1,23 @@ +# forms.py +from django import forms +from .models import Message, Reply, CustomUser + +class MessageForm(forms.ModelForm): + receivers = forms.ModelMultipleChoiceField( + queryset=CustomUser.objects.filter(is_active=True), + label="Receivers", + widget=forms.SelectMultiple(attrs={'class': 'form-control'}) + ) + + class Meta: + model = Message + fields = ['receivers', 'subject', 'body', 'attachment'] + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.fields['receivers'].label_from_instance = lambda obj: f"{obj.first_name} {obj.last_name}" + +class ReplyForm(forms.ModelForm): + class Meta: + model = Reply + fields = ['body', 'attachment'] diff --git a/skyonnweb/user/migrations/0001_initial.py b/skyonnweb/user/migrations/0001_initial.py new file mode 100644 index 0000000..621500f --- /dev/null +++ b/skyonnweb/user/migrations/0001_initial.py @@ -0,0 +1,40 @@ +# Generated by Django 4.2.11 on 2024-03-13 06:29 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='CustomUser', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('password', models.CharField(max_length=128, verbose_name='password')), + ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), + ('first_name', models.CharField(max_length=50)), + ('last_name', models.CharField(max_length=50)), + ('phone', models.CharField(max_length=15, unique=True)), + ('phone2', models.CharField(blank=True, max_length=15, null=True)), + ('company_email', models.EmailField(max_length=254, null=True)), + ('personal_email', models.EmailField(max_length=254, null=True)), + ('address', models.TextField(null=True)), + ('work_location', models.CharField(max_length=100, null=True)), + ('picture', models.ImageField(null=True, upload_to='profile_pics/')), + ('role', models.CharField(max_length=20)), + ('user_id', models.CharField(max_length=10, unique=True)), + ('is_active', models.BooleanField(default=True)), + ('is_staff', models.BooleanField(default=False)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ], + options={ + 'abstract': False, + }, + ), + ] diff --git a/skyonnweb/user/migrations/0002_jobposting.py b/skyonnweb/user/migrations/0002_jobposting.py new file mode 100644 index 0000000..894dd2e --- /dev/null +++ b/skyonnweb/user/migrations/0002_jobposting.py @@ -0,0 +1,33 @@ +# Generated by Django 4.2.11 on 2024-03-14 18:50 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='JobPosting', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('client', models.CharField(max_length=100)), + ('spoc', models.CharField(blank=True, max_length=100, null=True)), + ('start_date', models.DateField()), + ('budget_max', models.DecimalField(decimal_places=2, max_digits=10)), + ('job_description', models.TextField()), + ('special_instructions', models.CharField(blank=True, max_length=200, null=True)), + ('job_id', models.CharField(max_length=20)), + ('spoc_2', models.CharField(blank=True, max_length=100, null=True)), + ('close_date', models.DateField()), + ('location', models.CharField(max_length=100)), + ('no_of_posting', models.IntegerField()), + ('job_type', models.CharField(max_length=20)), + ('header', models.CharField(max_length=200)), + ('experience_in_years', models.IntegerField()), + ], + ), + ] diff --git a/skyonnweb/user/migrations/0003_customuser_manager_assigned.py b/skyonnweb/user/migrations/0003_customuser_manager_assigned.py new file mode 100644 index 0000000..39059e8 --- /dev/null +++ b/skyonnweb/user/migrations/0003_customuser_manager_assigned.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.11 on 2024-03-15 06:46 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0002_jobposting'), + ] + + operations = [ + migrations.AddField( + model_name='customuser', + name='manager_assigned', + field=models.CharField(max_length=100, null=True), + ), + ] diff --git a/skyonnweb/user/migrations/0004_jobposting_budget_min_alter_jobposting_budget_max.py b/skyonnweb/user/migrations/0004_jobposting_budget_min_alter_jobposting_budget_max.py new file mode 100644 index 0000000..158803a --- /dev/null +++ b/skyonnweb/user/migrations/0004_jobposting_budget_min_alter_jobposting_budget_max.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.11 on 2024-03-18 07:10 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0003_customuser_manager_assigned'), + ] + + operations = [ + migrations.AddField( + model_name='jobposting', + name='budget_min', + field=models.DecimalField(decimal_places=2, max_digits=10, null=True), + ), + migrations.AlterField( + model_name='jobposting', + name='budget_max', + field=models.DecimalField(decimal_places=2, max_digits=10, null=True), + ), + ] diff --git a/skyonnweb/user/migrations/0005_message.py b/skyonnweb/user/migrations/0005_message.py new file mode 100644 index 0000000..cd4e054 --- /dev/null +++ b/skyonnweb/user/migrations/0005_message.py @@ -0,0 +1,31 @@ +# Generated by Django 4.2.11 on 2024-04-08 06:07 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('user', '0004_jobposting_budget_min_alter_jobposting_budget_max'), + ] + + operations = [ + migrations.CreateModel( + name='Message', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('subject', models.CharField(max_length=255)), + ('body', models.TextField()), + ('is_read', models.BooleanField(default=False)), + ('sent_at', models.DateTimeField(auto_now_add=True)), + ('recipient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='received_messages', to=settings.AUTH_USER_MODEL)), + ('sender', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sent_messages', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'ordering': ['-sent_at'], + }, + ), + ] diff --git a/skyonnweb/user/migrations/0006_alter_jobposting_location.py b/skyonnweb/user/migrations/0006_alter_jobposting_location.py new file mode 100644 index 0000000..24d607a --- /dev/null +++ b/skyonnweb/user/migrations/0006_alter_jobposting_location.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.11 on 2024-04-08 06:31 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0005_message'), + ] + + operations = [ + migrations.AlterField( + model_name='jobposting', + name='location', + field=models.TextField(), + ), + ] diff --git a/skyonnweb/user/migrations/0007_spoc_remove_jobposting_budget_max_and_more.py b/skyonnweb/user/migrations/0007_spoc_remove_jobposting_budget_max_and_more.py new file mode 100644 index 0000000..edd52ef --- /dev/null +++ b/skyonnweb/user/migrations/0007_spoc_remove_jobposting_budget_max_and_more.py @@ -0,0 +1,160 @@ +# Generated by Django 5.0.6 on 2024-07-23 10:40 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0006_alter_jobposting_location'), + ] + + operations = [ + migrations.CreateModel( + name='SPOC', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, null=True)), + ], + ), + migrations.RemoveField( + model_name='jobposting', + name='budget_max', + ), + migrations.RemoveField( + model_name='jobposting', + name='budget_min', + ), + migrations.RemoveField( + model_name='jobposting', + name='client', + ), + migrations.RemoveField( + model_name='jobposting', + name='close_date', + ), + migrations.RemoveField( + model_name='jobposting', + name='experience_in_years', + ), + migrations.RemoveField( + model_name='jobposting', + name='header', + ), + migrations.RemoveField( + model_name='jobposting', + name='job_description', + ), + migrations.RemoveField( + model_name='jobposting', + name='job_id', + ), + migrations.RemoveField( + model_name='jobposting', + name='job_type', + ), + migrations.RemoveField( + model_name='jobposting', + name='location', + ), + migrations.RemoveField( + model_name='jobposting', + name='no_of_posting', + ), + migrations.RemoveField( + model_name='jobposting', + name='special_instructions', + ), + migrations.RemoveField( + model_name='jobposting', + name='spoc', + ), + migrations.RemoveField( + model_name='jobposting', + name='spoc_2', + ), + migrations.RemoveField( + model_name='jobposting', + name='start_date', + ), + migrations.AddField( + model_name='jobposting', + name='BudgetMax', + field=models.DecimalField(decimal_places=2, max_digits=10, null=True), + ), + migrations.AddField( + model_name='jobposting', + name='BudgetMin', + field=models.DecimalField(decimal_places=2, max_digits=10, null=True), + ), + migrations.AddField( + model_name='jobposting', + name='CloseDate', + field=models.DateField(null=True), + ), + migrations.AddField( + model_name='jobposting', + name='Experience_in_Yrs', + field=models.CharField(max_length=50, null=True), + ), + migrations.AddField( + model_name='jobposting', + name='JD', + field=models.FileField(null=True, upload_to='JD'), + ), + migrations.AddField( + model_name='jobposting', + name='JobDescription', + field=models.TextField(null=True), + ), + migrations.AddField( + model_name='jobposting', + name='JobID', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='jobposting', + name='NoOfPosting', + field=models.IntegerField(null=True), + ), + migrations.AddField( + model_name='jobposting', + name='SPOC2', + field=models.CharField(blank=True, max_length=255, null=True), + ), + migrations.AddField( + model_name='jobposting', + name='SpecialInstructions', + field=models.TextField(blank=True, null=True), + ), + migrations.AddField( + model_name='jobposting', + name='StartDate', + field=models.DateField(null=True), + ), + migrations.AddField( + model_name='jobposting', + name='Type', + field=models.CharField(max_length=50, null=True), + ), + migrations.AddField( + model_name='jobposting', + name='Client', + field=models.CharField(blank=True, max_length=100, null=True), + ), + migrations.AddField( + model_name='jobposting', + name='Header', + field=models.CharField(max_length=255, null=True), + ), + migrations.AddField( + model_name='jobposting', + name='Location', + field=models.CharField(max_length=255, null=True), + ), + migrations.AddField( + model_name='jobposting', + name='SPOC', + field=models.CharField(max_length=255, null=True), + ), + ] diff --git a/skyonnweb/user/migrations/0008_jobposting_slice_jd_alter_jobposting_jd.py b/skyonnweb/user/migrations/0008_jobposting_slice_jd_alter_jobposting_jd.py new file mode 100644 index 0000000..3bf3695 --- /dev/null +++ b/skyonnweb/user/migrations/0008_jobposting_slice_jd_alter_jobposting_jd.py @@ -0,0 +1,23 @@ +# Generated by Django 5.0.6 on 2024-07-25 06:36 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0007_spoc_remove_jobposting_budget_max_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='jobposting', + name='slice_JD', + field=models.CharField(max_length=255, null=True), + ), + migrations.AlterField( + model_name='jobposting', + name='JD', + field=models.FileField(null=True, upload_to='JD/'), + ), + ] diff --git a/skyonnweb/user/migrations/0009_alter_jobposting_jobdescription.py b/skyonnweb/user/migrations/0009_alter_jobposting_jobdescription.py new file mode 100644 index 0000000..4d6bc94 --- /dev/null +++ b/skyonnweb/user/migrations/0009_alter_jobposting_jobdescription.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.11 on 2024-08-09 06:48 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0008_jobposting_slice_jd_alter_jobposting_jd'), + ] + + operations = [ + migrations.AlterField( + model_name='jobposting', + name='JobDescription', + field=models.TextField(max_length=300, null=True), + ), + ] diff --git a/skyonnweb/user/migrations/0010_alter_jobposting_jobdescription.py b/skyonnweb/user/migrations/0010_alter_jobposting_jobdescription.py new file mode 100644 index 0000000..063c48b --- /dev/null +++ b/skyonnweb/user/migrations/0010_alter_jobposting_jobdescription.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.11 on 2024-08-09 06:50 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0009_alter_jobposting_jobdescription'), + ] + + operations = [ + migrations.AlterField( + model_name='jobposting', + name='JobDescription', + field=models.TextField(null=True), + ), + ] diff --git a/skyonnweb/user/migrations/0011_alter_customuser_role.py b/skyonnweb/user/migrations/0011_alter_customuser_role.py new file mode 100644 index 0000000..8a51b9b --- /dev/null +++ b/skyonnweb/user/migrations/0011_alter_customuser_role.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.11 on 2024-08-09 07:10 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0010_alter_jobposting_jobdescription'), + ] + + operations = [ + migrations.AlterField( + model_name='customuser', + name='role', + field=models.CharField(max_length=200), + ), + ] diff --git a/skyonnweb/user/migrations/0012_alter_customuser_role.py b/skyonnweb/user/migrations/0012_alter_customuser_role.py new file mode 100644 index 0000000..15fe9d3 --- /dev/null +++ b/skyonnweb/user/migrations/0012_alter_customuser_role.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.11 on 2024-08-09 07:16 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0011_alter_customuser_role'), + ] + + operations = [ + migrations.AlterField( + model_name='customuser', + name='role', + field=models.CharField(max_length=20), + ), + ] diff --git a/skyonnweb/user/migrations/0013_delete_spoc.py b/skyonnweb/user/migrations/0013_delete_spoc.py new file mode 100644 index 0000000..612f91a --- /dev/null +++ b/skyonnweb/user/migrations/0013_delete_spoc.py @@ -0,0 +1,16 @@ +# Generated by Django 5.1.1 on 2024-09-16 07:52 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0012_alter_customuser_role'), + ] + + operations = [ + migrations.DeleteModel( + name='SPOC', + ), + ] diff --git a/skyonnweb/user/migrations/0014_spoc.py b/skyonnweb/user/migrations/0014_spoc.py new file mode 100644 index 0000000..591e1f8 --- /dev/null +++ b/skyonnweb/user/migrations/0014_spoc.py @@ -0,0 +1,20 @@ +# Generated by Django 5.1.1 on 2024-09-17 05:57 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0013_delete_spoc'), + ] + + operations = [ + migrations.CreateModel( + name='SPOC', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, null=True)), + ], + ), + ] diff --git a/skyonnweb/user/migrations/0015_delete_spoc.py b/skyonnweb/user/migrations/0015_delete_spoc.py new file mode 100644 index 0000000..c26ec9b --- /dev/null +++ b/skyonnweb/user/migrations/0015_delete_spoc.py @@ -0,0 +1,16 @@ +# Generated by Django 5.1.1 on 2024-09-17 05:58 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0014_spoc'), + ] + + operations = [ + migrations.DeleteModel( + name='SPOC', + ), + ] diff --git a/skyonnweb/user/migrations/0016_spoc.py b/skyonnweb/user/migrations/0016_spoc.py new file mode 100644 index 0000000..6f93979 --- /dev/null +++ b/skyonnweb/user/migrations/0016_spoc.py @@ -0,0 +1,20 @@ +# Generated by Django 5.1.1 on 2024-09-17 05:58 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0015_delete_spoc'), + ] + + operations = [ + migrations.CreateModel( + name='SPOC', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, null=True)), + ], + ), + ] diff --git a/skyonnweb/user/migrations/0017_rename_type_jobposting_qualification.py b/skyonnweb/user/migrations/0017_rename_type_jobposting_qualification.py new file mode 100644 index 0000000..eeadcca --- /dev/null +++ b/skyonnweb/user/migrations/0017_rename_type_jobposting_qualification.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.1 on 2024-09-17 06:37 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0016_spoc'), + ] + + operations = [ + migrations.RenameField( + model_name='jobposting', + old_name='Type', + new_name='Qualification', + ), + ] diff --git a/skyonnweb/user/migrations/0018_delete_spoc_remove_jobposting_qualification.py b/skyonnweb/user/migrations/0018_delete_spoc_remove_jobposting_qualification.py new file mode 100644 index 0000000..da47a3a --- /dev/null +++ b/skyonnweb/user/migrations/0018_delete_spoc_remove_jobposting_qualification.py @@ -0,0 +1,20 @@ +# Generated by Django 5.1.1 on 2024-09-17 06:39 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0017_rename_type_jobposting_qualification'), + ] + + operations = [ + migrations.DeleteModel( + name='SPOC', + ), + migrations.RemoveField( + model_name='jobposting', + name='Qualification', + ), + ] diff --git a/skyonnweb/user/migrations/0019_jobposting_qualification.py b/skyonnweb/user/migrations/0019_jobposting_qualification.py new file mode 100644 index 0000000..7cbff52 --- /dev/null +++ b/skyonnweb/user/migrations/0019_jobposting_qualification.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.1 on 2024-09-17 06:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0018_delete_spoc_remove_jobposting_qualification'), + ] + + operations = [ + migrations.AddField( + model_name='jobposting', + name='Qualification', + field=models.CharField(max_length=50, null=True), + ), + ] diff --git a/skyonnweb/user/migrations/0020_alter_jobposting_qualification.py b/skyonnweb/user/migrations/0020_alter_jobposting_qualification.py new file mode 100644 index 0000000..09e52a2 --- /dev/null +++ b/skyonnweb/user/migrations/0020_alter_jobposting_qualification.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.1 on 2024-09-19 11:21 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0019_jobposting_qualification'), + ] + + operations = [ + migrations.AlterField( + model_name='jobposting', + name='Qualification', + field=models.CharField(max_length=100, null=True), + ), + ] diff --git a/skyonnweb/user/migrations/0021_delete_jobposting.py b/skyonnweb/user/migrations/0021_delete_jobposting.py new file mode 100644 index 0000000..2195ccf --- /dev/null +++ b/skyonnweb/user/migrations/0021_delete_jobposting.py @@ -0,0 +1,16 @@ +# Generated by Django 5.1.1 on 2024-09-19 11:22 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0020_alter_jobposting_qualification'), + ] + + operations = [ + migrations.DeleteModel( + name='JobPosting', + ), + ] diff --git a/skyonnweb/user/migrations/0022_delete_customuser_delete_message.py b/skyonnweb/user/migrations/0022_delete_customuser_delete_message.py new file mode 100644 index 0000000..e1cb08a --- /dev/null +++ b/skyonnweb/user/migrations/0022_delete_customuser_delete_message.py @@ -0,0 +1,19 @@ +# Generated by Django 4.2.11 on 2024-09-19 11:32 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0021_delete_jobposting'), + ] + + operations = [ + migrations.DeleteModel( + name='CustomUser', + ), + migrations.DeleteModel( + name='Message', + ), + ] diff --git a/skyonnweb/user/migrations/0023_initial.py b/skyonnweb/user/migrations/0023_initial.py new file mode 100644 index 0000000..b7993f3 --- /dev/null +++ b/skyonnweb/user/migrations/0023_initial.py @@ -0,0 +1,83 @@ +# Generated by Django 4.2.11 on 2024-09-19 11:34 + +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), + ('user', '0022_delete_customuser_delete_message'), + ] + + operations = [ + migrations.CreateModel( + name='CustomUser', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('password', models.CharField(max_length=128, verbose_name='password')), + ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), + ('first_name', models.CharField(max_length=50)), + ('last_name', models.CharField(max_length=50)), + ('phone', models.CharField(max_length=15, unique=True)), + ('phone2', models.CharField(blank=True, max_length=15, null=True)), + ('company_email', models.EmailField(max_length=254, null=True)), + ('personal_email', models.EmailField(max_length=254, null=True)), + ('address', models.TextField(null=True)), + ('work_location', models.CharField(max_length=100, null=True)), + ('picture', models.ImageField(null=True, upload_to='profile_pics/')), + ('role', models.CharField(max_length=20)), + ('user_id', models.CharField(max_length=10, unique=True)), + ('is_active', models.BooleanField(default=True)), + ('is_staff', models.BooleanField(default=False)), + ('manager_assigned', models.CharField(max_length=100, null=True)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='JobPosting', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('Client', models.CharField(blank=True, max_length=100, null=True)), + ('JobID', models.CharField(max_length=100, null=True)), + ('Location', models.CharField(max_length=255, null=True)), + ('SPOC', models.CharField(max_length=255, null=True)), + ('SPOC2', models.CharField(blank=True, max_length=255, null=True)), + ('NoOfPosting', models.IntegerField(null=True)), + ('StartDate', models.DateField(null=True)), + ('CloseDate', models.DateField(null=True)), + ('BudgetMin', models.DecimalField(decimal_places=2, max_digits=10, null=True)), + ('BudgetMax', models.DecimalField(decimal_places=2, max_digits=10, null=True)), + ('Qualification', models.CharField(max_length=100, null=True)), + ('Header', models.CharField(max_length=255, null=True)), + ('JobDescription', models.TextField(null=True)), + ('Experience_in_Yrs', models.CharField(max_length=50, null=True)), + ('SpecialInstructions', models.TextField(blank=True, null=True)), + ('JD', models.FileField(null=True, upload_to='JD/')), + ('slice_JD', models.CharField(max_length=255, null=True)), + ], + ), + migrations.CreateModel( + name='Message', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('subject', models.CharField(max_length=255)), + ('body', models.TextField()), + ('is_read', models.BooleanField(default=False)), + ('sent_at', models.DateTimeField(auto_now_add=True)), + ('recipient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='received_messages', to=settings.AUTH_USER_MODEL)), + ('sender', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sent_messages', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'ordering': ['-sent_at'], + }, + ), + ] diff --git a/skyonnweb/user/migrations/0024_delete_message.py b/skyonnweb/user/migrations/0024_delete_message.py new file mode 100644 index 0000000..271e9d2 --- /dev/null +++ b/skyonnweb/user/migrations/0024_delete_message.py @@ -0,0 +1,16 @@ +# Generated by Django 4.2.11 on 2024-12-03 10:56 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0023_initial'), + ] + + operations = [ + migrations.DeleteModel( + name='Message', + ), + ] diff --git a/skyonnweb/user/migrations/0025_alter_jobposting_budgetmin.py b/skyonnweb/user/migrations/0025_alter_jobposting_budgetmin.py new file mode 100644 index 0000000..09e4b1d --- /dev/null +++ b/skyonnweb/user/migrations/0025_alter_jobposting_budgetmin.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.11 on 2024-12-09 07:09 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0024_delete_message'), + ] + + operations = [ + migrations.AlterField( + model_name='jobposting', + name='BudgetMin', + field=models.CharField(max_length=20, null=True), + ), + ] diff --git a/skyonnweb/user/migrations/0026_remove_jobposting_budgetmax.py b/skyonnweb/user/migrations/0026_remove_jobposting_budgetmax.py new file mode 100644 index 0000000..39d3dd2 --- /dev/null +++ b/skyonnweb/user/migrations/0026_remove_jobposting_budgetmax.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.11 on 2024-12-09 07:12 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0025_alter_jobposting_budgetmin'), + ] + + operations = [ + migrations.RemoveField( + model_name='jobposting', + name='BudgetMax', + ), + ] diff --git a/skyonnweb/user/migrations/0027_jobposting_maxamount_jobposting_minamount_and_more.py b/skyonnweb/user/migrations/0027_jobposting_maxamount_jobposting_minamount_and_more.py new file mode 100644 index 0000000..6986067 --- /dev/null +++ b/skyonnweb/user/migrations/0027_jobposting_maxamount_jobposting_minamount_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 4.2.11 on 2024-12-09 07:29 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0026_remove_jobposting_budgetmax'), + ] + + operations = [ + migrations.AddField( + model_name='jobposting', + name='maxAmount', + field=models.CharField(max_length=20, null=True), + ), + migrations.AddField( + model_name='jobposting', + name='minAmount', + field=models.CharField(max_length=20, null=True), + ), + migrations.AddField( + model_name='jobposting', + name='timePeriod', + field=models.CharField(max_length=20, null=True), + ), + ] diff --git a/skyonnweb/user/migrations/__init__.py b/skyonnweb/user/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/skyonnweb/user/models.py b/skyonnweb/user/models.py new file mode 100644 index 0000000..f2a76cc --- /dev/null +++ b/skyonnweb/user/models.py @@ -0,0 +1,100 @@ +from django.db import models +from django.contrib.auth.models import AbstractBaseUser, BaseUserManager +from django.contrib.auth.models import User + +class CustomUserManager(BaseUserManager): + def create_user(self, phone, password=None, **extra_fields): + if not phone: + raise ValueError('The Phone number must be set') + user = self.model(phone=phone, **extra_fields) + user.set_password(password) + user.save(using=self._db) + return user + + def create_superuser(self, phone, password=None, **extra_fields): + extra_fields.setdefault('is_staff', True) + extra_fields.setdefault('is_superuser', True) + return self.create_user(phone, password, **extra_fields) + + +class CustomUser(AbstractBaseUser): + first_name = models.CharField(max_length=50) + last_name = models.CharField(max_length=50) + phone = models.CharField(max_length=15, unique=True) + phone2 = models.CharField(max_length=15, blank=True, null=True) + company_email = models.EmailField(null=True) + personal_email = models.EmailField(null=True) + address = models.TextField(null=True) + work_location = models.CharField(max_length=100, null=True) + picture = models.ImageField(upload_to='profile_pics/', null=True) + role = models.CharField(max_length=20) + user_id = models.CharField(max_length=10, unique=True) + is_active = models.BooleanField(default=True) + is_staff = models.BooleanField(default=False) + manager_assigned = models.CharField(max_length=100, null=True) + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) + + objects = CustomUserManager() + + USERNAME_FIELD = 'phone' + + +# class JobPosting(models.Model): +# client = models.CharField(max_length=100) +# spoc = models.CharField(max_length=100, blank=True, null=True) +# start_date = models.DateField() +# budget_max = models.DecimalField(max_digits=10, decimal_places=2, null=True) +# budget_min = models.DecimalField(max_digits=10, decimal_places=2, null=True) +# job_description = models.TextField() +# special_instructions = models.CharField(max_length=200, blank=True, null=True) +# job_id = models.CharField(max_length=20) +# spoc_2 = models.CharField(max_length=100, blank=True, null=True) +# close_date = models.DateField() +# location = models.TextField() # Changed from CharField to TextField +# no_of_posting = models.IntegerField() +# job_type = models.CharField(max_length=20) +# header = models.CharField(max_length=200) +# experience_in_years = models.IntegerField() +# +# def set_locations(self, location_list): +# self.location = ",".join(location_list) +# +# def get_locations(self): +# return self.location.split(",") +# +# def __str__(self): +# return self.job_id + +class JobPosting(models.Model): + Client = models.CharField(max_length=100, null=True, blank=True) + JobID = models.CharField(max_length=100,null=True) + Location = models.CharField(max_length=255,null=True) + SPOC = models.CharField(max_length=255,null=True) + SPOC2 = models.CharField(max_length=255, blank=True, null=True) + NoOfPosting = models.IntegerField(null=True) + StartDate = models.DateField(null=True) + CloseDate = models.DateField(null=True) + + BudgetMin = models.CharField(max_length=20,null=True) + timePeriod = models.CharField(max_length=20,null=True,blank=True) + minAmount = models.CharField(max_length=20,null=True) + maxAmount = models.CharField(max_length=20,null=True) + + Qualification = models.CharField(max_length=100,null=True) + Header = models.CharField(max_length=255,null=True) + JobDescription = models.TextField(null=True) + Experience_in_Yrs = models.CharField(max_length=50,null=True) + SpecialInstructions = models.TextField(blank=True, null=True) + JD = models.FileField(upload_to='JD/', null= True) + slice_JD = models.CharField(max_length=255,null=True) + + +# class SPOC(models.Model): +# name = models.CharField(max_length=255,null=True) +# +# def __str__(self): +# return self.name + + + diff --git a/skyonnweb/user/tests.py b/skyonnweb/user/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/skyonnweb/user/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/skyonnweb/user/urls.py b/skyonnweb/user/urls.py new file mode 100644 index 0000000..32a5b20 --- /dev/null +++ b/skyonnweb/user/urls.py @@ -0,0 +1,29 @@ +from django.urls import path +from . import views + +urlpatterns = [ + path('user/', views.home, name='home'), + path('create_user/', views.create_user, name='create_user'), # URL for creating user + path('user_login/', views.user_login, name='user_login'), # URL for login + + path('user/dashboard//', views.dashboard, name='dashboard'), + path('new_job_postings/', views.new_job_posting, name='new_job_postings'), + path('logout/', views.logout_view, name='logout'), + path('save-job-posting/', views.save_job_posting, name='save_job_posting'), + path('add_recruiter/', views.add_recruiter, name='add_recruiter'), + path('create_recruiter/', views.create_recruiter, name='create_recruiter'), + # path('send//', views.send_message, name='send_message'), + # path('read//', views.mark_as_read, name='mark_as_read'), + path('get_locations/', views.get_locations, name='get_locations'), + path('get_client_details/', views.get_client_details, name='get_client_details'), + path('new_job_posting/', views.new_job_posting, name='New_job_posting'), + path('get_contacts/', views.get_contacts, name='get_contacts'), + path('validate_field/', views.validate_field, name='validate_field'), + path('all_job_postings/', views.all_job_postings, name='All_job_postings'), + path('get_jobPosting/', views.get_jobPosting, name='get_jobPosting'), + # path('messages/', views.message_list, name='message_list'), + # path('messages//', views.message_detail, name='message_detail'), + # path('messages/new/', views.new_message, name='new_message'), + + path('messages/', views.messages, name='messages'), +] diff --git a/skyonnweb/user/views.py b/skyonnweb/user/views.py new file mode 100644 index 0000000..c3844fd --- /dev/null +++ b/skyonnweb/user/views.py @@ -0,0 +1,488 @@ +from django.shortcuts import render, redirect, get_object_or_404 +from django.contrib.auth import authenticate, login as auth_login, logout +from .models import CustomUser, JobPosting +from skyonnadmin.models import ClientDetails,SubcompanyDetails,Locations,AddContact,InternalTeam +from django.contrib import messages +from django.http import JsonResponse +from django.db.models import Q + +from django.contrib.auth.models import User +from django.http import HttpResponseRedirect +import os +from django.core.files.storage import FileSystemStorage +import json +from django.core.serializers.json import DjangoJSONEncoder + +def home(request): + return render(request, 'user/home.html') + + +def create_user(request): + if request.method == 'POST': + # Handle signup form submission + first_name = request.POST.get('first_name') + last_name = request.POST.get('last_name') + phone = request.POST.get('phone') + phone2 = request.POST.get('phone_2') + company_email = request.POST.get('company_email') + personal_email = request.POST.get('personal_email') + address = request.POST.get('address') + work_location = request.POST.get('work_location') + role = request.POST.get('role') + password = request.POST.get('password') + picture = request.FILES.get('picture') + + # Create user_id based on role + role_prefix = role[0].upper() + user_count = CustomUser.objects.filter(role=role).count() + 1 + user_id = f"{role_prefix}{first_name[:3].upper()}{user_count:03}" + + # Create the CustomUser object + user = CustomUser.objects.create( + first_name=first_name, + last_name=last_name, + phone=phone, + phone2=phone2, + company_email=company_email, + personal_email=personal_email, + address=address, + work_location=work_location, + role=role, + user_id=user_id + ) + user.set_password(password) + user.picture = picture + user.save() + user.backend = 'user.backend.PhoneAuthenticationBackend' + auth_login(request, user) + + return redirect('dashboard', user_id=user.user_id) + else: + return render(request, 'user/home.html') + + +# def user_login(request): +# if request.method == 'POST': +# phone = request.POST.get('phone') +# password = request.POST.get('password') +# +# user = authenticate(request, phone=phone, password=password) +# # print(phone, password, user) +# if user is not None: +# auth_login(request, user) +# user = CustomUser.objects.filter(phone=phone).first() +# if user: +# # print(user.user_id) +# return redirect('dashboard', user_id=user.user_id) +# else: +# messages.error(request, 'No user found for the provided phone number.') +# else: +# messages.error(request, 'Invalid phone number or password.') +# +# return render(request, 'user/home.html') + + +def user_login(request): + if request.method == 'POST': + phone = request.POST.get('phone') + password = request.POST.get('password') + + if not phone and 'phone' in request.POST: + return JsonResponse({'error': 'Please fill the phone number field.'}, status=400) + if not password and 'password' in request.POST: # Validate password if it's present + return JsonResponse({'error': 'Please fill the password field.'}, status=400) + + user = InternalTeam.objects.filter(Login=phone).first() + if user is None: + return JsonResponse({'error': 'Incorrect Email.'}, status=404) + + if password: + match = InternalTeam.objects.filter(Login=phone,Password=password).first() + if not match: + return JsonResponse({'error': 'Incorrect password.'}, status=401) + + return JsonResponse( + {'success': 'Login successful', 'redirect_url': f'/user/dashboard/{user.user_id}'}) + + return JsonResponse({'success': 'Phone number is valid.'}, status=200) + + return JsonResponse({'error': 'Invalid request method.'}, status=405) + + +def dashboard(request, user_id): + # Retrieve the manager object using manager_id + user = get_object_or_404(InternalTeam, user_id=user_id) + print('user_id:',user_id) + + # Get the manager's first name + first_name = user.FirstName.capitalize() + last_name = user.LastName.capitalize() + full_name = f"{first_name}'s" + + return render(request, 'user/dashboard.html', {'first_name': full_name, 'user_id': user_id}) + +# def dashboard(request, user_id): +# # Retrieve the manager object using manager_id +# user = get_object_or_404(CustomUser, user_id=user_id) +# print('user_id:', user_id) +# +# # Get the manager's first name +# first_name = user.FirstName.capitalize() +# full_name = f"{first_name}'s" +# print(full_name) +# +# if user.role == 'manager': +# print("hiii") +# return render(request, 'user/test.html', {'first_name': full_name, 'user_id': user_id}) +# +# if user.role == 'recruiter': +# return render(request, 'recruiter/recruiter_dashboard.html', {'first_name': full_name, 'user_id': user_id}) + + +def new_job_posting(request): + locations = Locations.objects.all() + clients = ClientDetails.objects.all() + return render(request, 'user/new_job_posting.html', {'clients': clients,'locations':locations}) + + +def add_recruiter(request): + user_id = request.GET.get('user_id', None) + print(user_id) + context = {'user_id': user_id} + return render(request, 'user/add_recruiter.html', context) + + +def logout_view(request): + logout(request) + return redirect('home') + + +# def save_job_posting(request): +# if request.method == 'POST': +# client = request.POST.get('Client') +# spoc = request.POST.get('SPOC') +# start_date = request.POST.get('StartDate') +# budget_max = request.POST.get('BudgetMax') +# budget_min = request.POST.get('BudgetMin') +# job_description = request.POST.get('JobDescription') +# special_instructions = request.POST.get('SpecialInstructions') +# job_id = request.POST.get('JobID') +# spoc_2 = request.POST.get('SPOC2') +# close_date = request.POST.get('CloseDate') +# locations = request.POST.getlist('Location') # Use getlist to handle multiple selections +# no_of_posting = request.POST.get('NoOfPosting') +# job_type = request.POST.get('Type') +# header = request.POST.get('Header') +# experience_in_years = request.POST.get('Experience_in_Yrs') +# +# job_posting = JobPosting( +# client=client, +# spoc=spoc, +# budget_min=budget_min, +# start_date=start_date, +# budget_max=budget_max, +# job_description=job_description, +# special_instructions=special_instructions, +# job_id=job_id, +# spoc_2=spoc_2, +# close_date=close_date, +# no_of_posting=no_of_posting, +# job_type=job_type, +# header=header, +# experience_in_years=experience_in_years +# ) +# job_posting.set_locations(locations) # Save the locations as a comma-separated string +# job_posting.save() +# return JsonResponse({'status': 'success', 'message': 'Job posting saved successfully.'}) +# +# return redirect('error_url') +# + +def save_job_posting(request): + if request.method == 'POST': + # Extract data from the form + Client = request.POST.get('Client', '') + JobID = request.POST.get('JobID', '') + Location = request.POST.get('Location', '') + SPOC = request.POST.get('SPOC', '') + SPOC2 = request.POST.get('SPOC2', '') + StartDate = request.POST.get('StartDate', '') + CloseDate = request.POST.get('CloseDate', '') + BudgetMin = request.POST.get('BudgetMin', '') + timePeriod = request.POST.get('timePeriod', '') + minAmount = request.POST.get('minAmount', '') + maxAmount = request.POST.get('maxAmount', '') + Header = request.POST.get('Header', '') + JobDescription = request.POST.get('JobDescription', '') + Experience_in_Yrs = request.POST.get('Experience', '') + NoOfPosting = request.POST.get('NoOfPosting', '') + Qualification = request.POST.get('Qualification', '').upper() + SpecialInstructions = request.POST.get('SpecialInstructions', '') + + JD = None + slice_JD = None + if request.FILES.get('JD'): + myfile = request.FILES['JD'] + file_extension = os.path.splitext(myfile.name)[1] # Get the file extension + filename = f"{JobID}{file_extension}" # Create the new filename using job_id + fs = FileSystemStorage() + filename = fs.save(filename, myfile) + JD = fs.url(filename) # Get the URL to the file + slice_JD = JD[7:] + + jobposting = JobPosting( + Client=Client, + JobID=JobID, + Location=Location, + SPOC=SPOC, + SPOC2=SPOC2, + StartDate=StartDate, + CloseDate=CloseDate, + BudgetMin=BudgetMin, + timePeriod=timePeriod, + minAmount=minAmount, + maxAmount=maxAmount, + Qualification=Qualification, + Header=Header, + JobDescription=JobDescription, + Experience_in_Yrs=Experience_in_Yrs, + NoOfPosting=NoOfPosting, + SpecialInstructions=SpecialInstructions, + JD=JD, + slice_JD=slice_JD + ) + jobposting.save() + print(jobposting) + + admin_id = request.GET.get('admin_id', None) + print(admin_id) + + return JsonResponse({'status': 'success', 'message': 'Job_posting saved successfully.'}) + + else: + return JsonResponse({'status': 'error', 'message': 'Invalid request method'}, status=400) + + + +def create_recruiter(request): + if request.method == 'POST': + # Handle signup form submission + # print(request.post) + first_name = request.POST.get('first_name') + last_name = request.POST.get('last_name') + phone = request.POST.get('phone') + phone2 = request.POST.get('phone_2') + company_email = request.POST.get('company_email') + personal_email = request.POST.get('personal_email') + address = request.POST.get('address') + work_location = request.POST.get('work_location') + role = "recruiter" # request.POST.get('role') + password = request.POST.get('password') + picture = request.FILES.get('picture') + manager_assigned = request.POST.get('manager_assigned', None) + print(manager_assigned, 1) + # Create user_id based on role + role_prefix = role[0].upper() + user_count = CustomUser.objects.filter(role=role).count() + 1 + user_id = f"{role_prefix}{first_name[:3].upper()}{user_count:03}" + + # Create the CustomUser object + user = CustomUser.objects.create( + first_name=first_name, + last_name=last_name, + phone=phone, + phone2=phone2, + company_email=company_email, + personal_email=personal_email, + address=address, + work_location=work_location, + role=role, + user_id=user_id, + manager_assigned=manager_assigned + ) + user.set_password(password) + user.picture = picture + user.save() + return redirect('dashboard', user_id=manager_assigned) + # return JsonResponse({'success': True, 'message': 'Recruiter added successfully!'}) + + else: + messages.success(request, 'Data saved successfully.') + + # Instead of redirecting, render the same form page again + return render(request, 'user/add_recruiter.html') + + +def send_message(request, recipient_id): + recipient = get_object_or_404(User, pk=recipient_id) + if request.method == 'POST': + subject = request.POST.get('subject') + body = request.POST.get('body') + message = Message.objects.create(sender=request.user, recipient=recipient, subject=subject, body=body) + return redirect('messages') + return render(request, 'send_message.html', {'recipient': recipient}) + + +def mark_as_read(request, message_id): + message = get_object_or_404(Message, pk=message_id, recipient=request.user) + message.is_read = True + message.save() + return redirect('messages') + + +def get_locations(request): + if request.method == 'GET': + client = request.GET.get('Client') + jobposting_locations = JobPosting.objects.filter(Client=client).values_list('Location').distinct() + client_locations = ClientDetails.objects.filter(parent_company=client).values_list('location_Id').distinct() + subclient_locations = SubcompanyDetails.objects.filter(parent_company=client).values_list('location_id').distinct() + + locations = set(jobposting_locations) | set(client_locations) | set(subclient_locations) + + location_list = list(locations) + return JsonResponse(location_list, safe=False) + else: + return JsonResponse({'error': 'Invalid request method'}, status=400) + + +def get_client_details(request): + if request.method == 'GET': + client = request.GET.get('client') + try: + # Retrieve a single ClientDetails object + client_obj = ClientDetails.objects.get(parent_company=client) + client_data = { + 'parent_company': client_obj.parent_company, + 'GST_No': client_obj.GST_No, + 'Location_Id': client_obj.location_Id, + 'Address_1': client_obj.address_1, + 'Address_2': client_obj.address_2, + 'City': client_obj.City, + 'State': client_obj.state, + 'Pincode': client_obj.Pincode, + 'Country': client_obj.country + } + return JsonResponse(client_data) + except ClientDetails.DoesNotExist: + return JsonResponse({'error': 'Client not found'}, status=404) + else: + return JsonResponse({'error': 'Invalid request method'}, status=400) + +def new_login(request): + if request.method == 'POST': + Login_id = request.POST.get('phone') + password = request.POST.get('password') + + print(Login_id, password) + + user = InternalTeam.objects.filter(Login=Login_id,Password=password).first() + print(user) + if user is not None: + + print(user.user_id) + return redirect('dashboard', user_id=user.user_id) + + else: + messages.error(request, 'Invalid phone number or password.') + + return render(request, 'user/home.html') + +def new_job_posting(request): + clients = ClientDetails.objects.all() + user_id = request.GET.get('user_id', None) + print('opened newJobPosting:',user_id) + user = get_object_or_404(InternalTeam,user_id=user_id) + print(user.Level) + + restricted =bool(int((user.Level)[6:]) < 5) + + if restricted==True: + return render(request, 'user/new_job_posting.html', {'user': user, 'clients': clients, 'user_id': user_id, 'restricted': True}) + else: + return render(request, 'user/new_job_posting.html', {'user': user,'clients': clients,'user_id': user_id, 'restricted': False}) + + +def get_contacts(request): + if request.method == 'GET': + client = request.GET.get('Client') + print(client) + SPOC_Details = AddContact.objects.filter(Company=client).values('FirstName','LastName') + + SPOC_Details_list = list(SPOC_Details) + return JsonResponse(SPOC_Details_list, safe=False) + else: + return JsonResponse({'error': 'Invalid request'}) + +def validate_field(request): + if request.method == 'GET': + email = request.GET.get('Email') + phone_number = request.GET.get('Phone_number') + response = { + 'exists': False + } + if email and AddContact.objects.filter(Email=email).exists(): + response['exists'] = True + elif phone_number and AddContact.objects.filter(Phone_number=phone_number).exists(): + response['exists'] = True + return JsonResponse(response) + + +def all_job_postings(request): + user_id = request.GET.get('user_id', None) + print('opened allJobPosting:', user_id) + clients = ClientDetails.objects.all() + user = get_object_or_404(InternalTeam, user_id=user_id) + print(user.Level) + + restricted = bool(int((user.Level)[6:]) < 5) + + if restricted == True: + job_postings = JobPosting.objects.all() + return render(request, 'user/all_job_postings.html', + {'user': user, 'clients': clients, 'user_id': user_id, 'restricted': True,'job_postings': job_postings}) + else: + query = request.GET.get('query', '') # Get the query parameter if it exists + + if query: + job_postings = (JobPosting.objects.filter(job_id__icontains=query) | + JobPosting.objects.filter(spoc__icontains=query) | + JobPosting.objects.filter(client__icontains=query )) + else: + job_postings = JobPosting.objects.all() + + return render(request, 'user/all_job_postings.html', + {'user': user, 'clients': clients, 'user_id': user_id, 'restricted': False,'job_postings': job_postings}) + + +def get_jobPosting(request): + if request.method == 'GET': + jobId = request.GET.get('JobId') + try: + # Retrieve a single ClientDetails object + job_obj = JobPosting.objects.get(JobID=jobId) + job_data = { + 'Client': job_obj.Client, + 'JobID': job_obj.JobID, + 'Location': job_obj.Location, + 'SPOC': job_obj.SPOC, + 'SPOC2': job_obj.SPOC2, + 'NoOfPosting': job_obj.NoOfPosting, + 'StartDate': job_obj.StartDate, + 'CloseDate': job_obj.CloseDate, + 'Experience_in_Yrs': job_obj.Experience_in_Yrs, + 'BudgetMin': job_obj.BudgetMin, + 'Qualification': job_obj.Qualification, + 'Header': job_obj.Header, + 'JobDescription': job_obj.JobDescription, + 'SpecialInstructions': job_obj.SpecialInstructions + } + return JsonResponse(job_data) + except JobPosting.DoesNotExist: + return JsonResponse({'error': 'Job Posting not found'}, status=404) + else: + return JsonResponse({'error': 'Invalid request method'}, status=400) + + +def messages(request): + user_id= request.GET.get('úser_id') + return render(request, 'user/Messages.html',{'user_id': user_id}) \ No newline at end of file