Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions FusionIIIT/Fusion/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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': [
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions FusionIIIT/applications/placement_cell/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# imports
import datetime

from django.db import models
from django.utils import timezone
from django.utils.translation import gettext as _
Expand Down
94 changes: 19 additions & 75 deletions FusionIIIT/applications/placement_cell/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 = ''
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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()
Expand All @@ -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:
Expand Down Expand Up @@ -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()
Expand All @@ -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:
Expand Down Expand Up @@ -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<datetime.datetime.now():
#print('---------- time limit is finished---------------- \n\n\n\n\n')
ps.invitation = 'IGNORE'
ps.save()
except Exception as e:
Expand All @@ -2805,7 +2751,7 @@ def add_placement_schedule(request):

all_schedule_data=PlacementSchedule.objects.all()
students=NotifyStudent.objects.all()
#avail_role=Role.objects.all()

print(students)
apply_for=Role.objects.all()
print(all_schedule_data)
Expand All @@ -2820,7 +2766,6 @@ def add_placement_schedule(request):
}
return render(request, 'placementModule/add_placement_schedule.html', context)

#saves added details in PlacementSchedule table
def placement_schedule_save(request):
if request.method!="POST":
return HttpResponse("Method Not Allowed")
Expand All @@ -2833,11 +2778,10 @@ def placement_schedule_save(request):
title=request.POST.get("title")
location = request.POST.get("location")
role = request.POST.get("role")
resume = request.POST.get("resume") #file
resume = request.POST.get("resume")
schedule_at = request.POST.get("schedule_at")
date = request.POST.get("placement_date")
try:
#print("In try!!!")
role_create=Role.objects.create(role=role)
notify = NotifyStudent.objects.create(placement_type=placement_type,
company_name=company_name,
Expand Down Expand Up @@ -2868,7 +2812,7 @@ def delete_placement_record(request):
if 'delete_stats' in request.POST:
record_id = int(request.POST['delete_stats'])

#placement_record = PlacementRecord.objects.get(id=record_id)

PlacementRecord.objects.filter(id=record_id).delete()

messages.success(request, 'Placement Statistics deleted Successfully!!')
Expand Down
Loading