diff --git a/FusionIIIT/Fusion/settings/common.py b/FusionIIIT/Fusion/settings/common.py index 9fbf57256..d73068731 100644 --- a/FusionIIIT/Fusion/settings/common.py +++ b/FusionIIIT/Fusion/settings/common.py @@ -170,7 +170,7 @@ TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [os.path.join(BASE_DIR, '..', 'templates/'),], + 'DIRS': [os.path.join(BASE_DIR, '..', 'templates'),], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ @@ -254,9 +254,9 @@ # os.path.join(BASE_DIR, 'static/') STATIC_URL = '/static/' -STATIC_ROOT = os.path.join(BASE_DIR, '..', 'static/') +STATIC_ROOT = os.path.join(BASE_DIR, '..', 'static') STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' -MEDIA_ROOT = os.path.join(BASE_DIR, '..', 'media/') +MEDIA_ROOT = os.path.join(BASE_DIR, '..', 'media') MEDIA_URL = '/media/' ACCOUNT_USERNAME_REQUIRED = False diff --git a/FusionIIIT/applications/placement_cell/models.py b/FusionIIIT/applications/placement_cell/models.py index d9837608e..77ce99522 100644 --- a/FusionIIIT/applications/placement_cell/models.py +++ b/FusionIIIT/applications/placement_cell/models.py @@ -1,6 +1,4 @@ -# imports import datetime - from django.db import models from django.utils import timezone from django.utils.translation import gettext as _ diff --git a/FusionIIIT/applications/placement_cell/views.py b/FusionIIIT/applications/placement_cell/views.py index 80c8f12d7..888b39c3c 100644 --- a/FusionIIIT/applications/placement_cell/views.py +++ b/FusionIIIT/applications/placement_cell/views.py @@ -29,6 +29,7 @@ from notification.views import placement_cell_notif from applications.globals.models import (DepartmentInfo, ExtraInfo, HoldsDesignation) +from applications.academic_information.models import Student from .forms import (AddAchievement, AddChairmanVisit, AddCourse, AddEducation, AddExperience, AddReference, AddPatent, AddProfile, AddProject, AddPublication, AddSchedule, AddSkill, ManageHigherRecord, @@ -146,9 +147,7 @@ def get_reference_list(request): if request.method == 'POST': - # arr = request.POST.getlist('arr[]') - # print(arr) - # print(type(arr)) + user = request.user profile = get_object_or_404(ExtraInfo, Q(user=user)) student = get_object_or_404(Student, Q(id=profile.id)) @@ -250,16 +249,7 @@ def placement(request): address = request.POST.get('address') contact = request.POST.get('contact') pic = request.POST.get('pic') - # futu = request.POST.get('futu') - # print(studentplacement_obj.future_aspect) - # print('fut=', fut) - # print('futu=', futu) - # if studentplacement_obj.future_aspect == "HIGHER STUDIES": - # if futu == 2: - # studentplacement_obj.future_aspect = "PLACEMENT" - # elif studentplacement_obj.future_aspect == "PLACEMENT": - # if futu == None: - # studentplacement_obj.future_aspect = "HIGHER STUDIES" + extrainfo_obj = ExtraInfo.objects.get(user=user) extrainfo_obj.about_me = about_me extrainfo_obj.age = age @@ -1201,7 +1191,6 @@ def student_records(request): unique_id=student, no_of_days=no_of_days) for student in students] ) for st in students: - #print(request.user, '-----------------------', st.id.user,'-----------------') placement_cell_notif(request.user, st.id.user, "") students = '' @@ -1975,47 +1964,7 @@ def placement_statistics(request): id__icontains=rollno)) ))) - p = PlacementRecord.objects.filter(Q(placement_type="PLACEMENT", name__icontains=stuname, ctc__icontains=ctc, year__icontains=year)) - - - - - """placementrecord = StudentRecord.objects.select_related('unique_id','record_id').filter( - Q(record_id__in=PlacementRecord.objects.filter( - Q(placement_type="PLACEMENT", name__icontains=cname, ctc__gte=ctc, year=year)), - unique_id__in=Student.objects.filter( - (Q(id__in=ExtraInfo.objects.filter( - Q(user__in=User.objects.filter( - first_name__icontains=first_name, - last_name__icontains=last_name, - id__icontains=rollno)))))))) - #print("In if:", placementrecord) - else: - s = Student.objects.filter((Q(id__in=ExtraInfo.objects.filter( - Q(user__in=User.objects.filter( - first_name__icontains=first_name, - last_name__icontains=last_name), - id__icontains=rollno)) - ))) - - p = PlacementRecord.objects.filter(Q(placement_type="PLACEMENT", name__icontains=cname, ctc__gte=ctc)) - print("Agein p:",p) - placementrecord = StudentRecord.objects.select_related('unique_id','record_id').filter( - Q(record_id__in=PlacementRecord.objects.filter( - Q(placement_type="PLACEMENT", name__icontains=cname, ctc__gte=ctc)), - unique_id__in=Student.objects.filter( - (Q(id__in=ExtraInfo.objects.filter( - Q(user__in=User.objects.filter( - first_name__icontains=first_name, - last_name__icontains=last_name), - id__icontains=rollno))))))) - - request.session['first_name'] = first_name - request.session['last_name'] = last_name - request.session['ctc'] = ctc - request.session['cname'] = cname - request.session['rollno'] = rollno - request.session['year'] = form.cleaned_data['year']""" + p = PlacementRecord.objects.filter(Q(placement_type="PLACEMENT",name__icontains=stuname, ctc__icontains=ctc, year__icontains=year)) print(p) @@ -2605,20 +2554,20 @@ def cv(request, username): extracurricularcheck = '1' - # print(achievementcheck,' ',educationcheck,' ',publicationcheck,' ',patentcheck,' ',internshipcheck,' ',projectcheck,' \n\n\n') + user = get_object_or_404(User, Q(username=username)) profile = get_object_or_404(ExtraInfo, Q(user=user)) + student_info=get_object_or_404(Student,Q(id=user.username)) + + batch=student_info.batch + now = datetime.datetime.now() - if int(str(profile.id)[:2]) == 20: - if (now.month>4): - roll = 1+now.year-int(str(profile.id)[:4]) - else: - roll = now.year-int(str(profile.id)[:4]) + print("year----->",now.year) + if now.year-batch<=4: + roll=now.year-batch else: - if (now.month>4): - roll = 1+(now.year)-int("20"+str(profile.id)[0:2]) - else: - roll = (now.year)-int("20"+str(profile.id)[0:2]) + roll=4 + student = get_object_or_404(Student, Q(id=profile.id)) skills = Has.objects.select_related('skill_id','unique_id').filter(Q(unique_id=student)) @@ -2695,7 +2644,6 @@ def export_to_xls_std_records(qs): wb = xlwt.Workbook(encoding='utf-8') ws = wb.add_sheet('Report') - # Sheet header, first row row_num = 0 font_style = xlwt.XFStyle() @@ -2706,7 +2654,6 @@ def export_to_xls_std_records(qs): for col_num in range(len(columns)): ws.write(row_num, col_num, columns[col_num], font_style) - # Sheet body, remaining rows font_style = xlwt.XFStyle() for student in qs: @@ -2741,7 +2688,7 @@ def export_to_xls_invitation_status(qs): wb = xlwt.Workbook(encoding='utf-8') ws = wb.add_sheet('Report') - # Sheet header, first row + row_num = 0 font_style = xlwt.XFStyle() @@ -2752,7 +2699,7 @@ def export_to_xls_invitation_status(qs): for col_num in range(len(columns)): ws.write(row_num, col_num, columns[col_num], font_style) - # Sheet body, remaining rows + font_style = xlwt.XFStyle() for student in qs: @@ -2786,7 +2733,6 @@ def check_invitation_date(placementstatus): if ps.invitation=='PENDING': dt = ps.timestamp+datetime.timedelta(days=ps.no_of_days) if dt {% endif %} - {% endif %} {% endfor %} @@ -91,23 +87,8 @@ Placement Schedule - {% endif %} - - @@ -120,20 +101,9 @@ - - {% if current2 %} - - + {% if current2 %} - - Add Placement Record @@ -149,9 +119,6 @@ {% comment %}The Tab-Menu ends here!{% endcomment %} - {% comment %} - The left-rail segment ends here! - {% endcomment %} {% comment %} The central-rail segment starts here!{% endcomment %} @@ -219,17 +186,6 @@ - -
- {{ form3.ctc.errors }} - - -
- {{ form3.ctc }} -
-
@@ -250,7 +206,7 @@ {% elif placementrecord %}

- + {% if pagination_placement %}
@@ -289,7 +245,7 @@
{% endif %} - +

@@ -357,33 +313,17 @@

{% if placement_search_record != " " %} - - + - - - {% for rec in placement_search_record %} - - - - - - - - + + + {% endfor %} @@ -407,11 +347,10 @@

No Data Found.

- {% comment %}The add a new skill Accordian starts here!{% endcomment %}
- Search a Student! + Search a Student
{{ form3.non_field_errors }}
@@ -438,16 +377,6 @@

No Data Found.

-
- {{ form3.ctc.errors }} - - -
- {{ form3.ctc }} -
-
@@ -460,12 +389,12 @@

No Data Found.

- {% comment %}The add a new skill Accordian ends here!{% endcomment %} +

- + {% if pagination_pbi %}
@@ -504,7 +433,7 @@

No Data Found.

{% endif %} - +

@@ -667,14 +596,13 @@

No Data Found.

- {% comment %}The add a new skill Accordian ends here!{% endcomment %}

- + {% if pagination_higher %}
@@ -713,7 +641,7 @@

No Data Found.

{% endif %} - +

@@ -922,7 +850,6 @@

No Data Found.

- {% comment %} The central-rail segment ends here!{% endcomment %}
diff --git a/requirements.txt b/requirements.txt index da704c688..4cc3a0a30 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ beautifulsoup4==4.9.3 billiard==3.6.3.0 Brotli==1.0.9 bs4==0.0.1 -celery==5.2.3 +celery==5.0.5 certifi==2020.12.5 cffi==1.14.4 chardet==4.0.0 @@ -49,7 +49,7 @@ Pillow==8.1.0 prompt-toolkit==3.0.10 psycopg2-binary==2.8.6 pycparser==2.20 -PyJWT==2.0.1 +PyJWT==2.6.0 PyPDF2==1.26.0 pyrsistent==0.17.3 python-bidi==0.4.2 @@ -71,4 +71,4 @@ whitenoise==5.2.0 xhtml2pdf==0.2.5 xlrd==2.0.1 XlsxWriter==1.3.7 -xlwt==1.3.0 +xlwt==1.3.0 \ No newline at end of file
id TypePlacement TypeRoll No. Name CTCYearTest ScoreTest Type
{{ rec.id }}{{ rec.placement_type }}{{ rec.name }}{{ rec.ctc }}{{ rec.year }}{{ rec.test_score }}{{ rec.test_type }} -
- {% csrf_token %} - -
-
{{ rec.id }}{{ rec.name }}{{ rec.ctc }}