Skip to content
4 changes: 2 additions & 2 deletions Attendance/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,9 +776,9 @@ def get(self, request, *args, **kwargs):
font.size = Pt(11)

try:
document.add_picture('/home/wizdem/Attendance-System-Web/SAP/header.png', width=Inches(6))
document.add_picture('/home/wizdem/Attendance-System-Web/SAP/autonomous_header.jpeg', width=Inches(6))
except FileNotFoundError:
document.add_picture('SAP/header.png', width=Inches(6))
document.add_picture('SAP/autonomous_header.jpeg', width=Inches(6))
last_paragraph = document.paragraphs[-1]
last_paragraph.alignment = WD_ALIGN_PARAGRAPH.CENTER

Expand Down
File renamed without changes.
28 changes: 28 additions & 0 deletions SAP/2020WorkloadEven.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
SE,AOA,A,Pranit Bari/Neepa Shah
,,B,Pranit Bari
,COA,A,Aniket Kore
,,B,Aniket Kore
,CG,A,Khushali Deulkar/Neepa Shah
,,B,Khushali Deulkar/Neepa Shah
,OS,A,Chetashri Bhadane
,,B,Aruna Gawde
,OSTL,A,Deepika Dongre
,,B,Deepika Dongre
,Maths,A,Krupa Shikhare
,,B,Krupa Shikhare
TE,SE,A,Sudhir Bagul
,,B,Sudhir Bagul
,SPCC,A,Lynette D'Mello
,,B,Lynette D'Mello
,DWM,A,Kiran Bhowmick/Sindhu Nair
,,B,Kiran Bhowmick/Apoorva Joshi
,CSS,A,Sonali Jadhav
,,B,Ram Mangrulkar/ Sonali Jadhav
,ML,A,Ruhina karani
,,B,Kriti Srivastava
BE,HMI,A,Ashok Patade/Pratik Kanani
,,B,Ashok Patade/Pratik Kanani
,DC,A,Sindhu Nair/Nilambari Nadkar
,,B,Pankaj Sonawane/Nilambari Nadkar
,NLP,A,Lakshmi Kurup/Ruhina Karani
,,B,Lakshmi Kurup/Ruhina Karani
7 changes: 7 additions & 0 deletions SAP/SEADIP.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
64,60004198002,GANDHI BHAVYA JITENDRA KRUPALI
65,60004198003,JAIN VIDHI DINESH VAISHALI
66,60004198004,KAMATH SRIKANT MANISH
67,60004198007,RAGHANI URVI KIRAN
68,60004198008,RAMANI SMEET KIRAN
69,60004198009,ROBEY ALLAN ROBEY KAVITA
70,60004198010,SHAH DHAIRYA VIPUL ARCHANA
6 changes: 6 additions & 0 deletions SAP/SEBDIP.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
65,60004198001,AMOGH DESAI
66,60004198005,PARTH PANCHAL
67,60004198006,SANDEEP PARMAR
68,60004198011,KRUTIK SHAH
69,60004198012,YASHVI SHAH
70,60004198013,SHUBHAM UPADHYAY
Binary file added SAP/autonomous_header.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 49 additions & 4 deletions SAP/dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,51 @@
current_sem = "odd"


def PromoteDiv(div_name, old_semester, classteacher=None, old_year=current_year, with_pracs=False):
yearname, division = div_name.split("_")

div_exists = Div.objects.filter(semester=old_semester, calendar_year=old_year, division=division).exists()
if not div_exists:
raise Exception("Div not Found")

if with_pracs:
pracs_and_class = [division, division + "1", division + "2", division + "3", division + "4"]
for div in Div.objects.filter(semester=old_semester, calendar_year=old_year, division_in=pracs_and_class):
if classteacher:
names = classteacher.strip().split(' ')
teacher = Teacher.objects.get(user=AppUser.objects.get(first_name=names[0], last_name=names[1]))
new_div = Div.objects.create(semester=old_semester + 1, calendar_year=old_year + old_semester % 2,
division=div.division, classteacher=teacher)
else:
new_div = Div.objects.create(semester=old_semester + 1, calendar_year=old_year + old_semester % 2,
division=div.division)

studivs = StudentDivision.objects.filter(division=div)
for sd in studivs:
StudentDivision.objects.create(student=sd.student, division=new_div)
else:
if classteacher:
names = classteacher.strip().split(' ')
teacher = Teacher.objects.get(user=AppUser.objects.get(first_name=names[0], last_name=names[1]))
new_div = Div.objects.create(semester=old_semester + 1, calendar_year=old_year + old_semester % 2,
division=division, classteacher=teacher)
else:
new_div = Div.objects.create(semester=old_semester + 1, calendar_year=old_year + old_semester % 2,
division=division)

div = Div.objects.get(semester=old_semester, calendar_year=old_year, division=division)
studivs = StudentDivision.objects.filter(division=div)
for sd in studivs:
StudentDivision.objects.create(student=sd.student, division=new_div)
print("\033[92m{}\033[00m" .format(div_name + " promoted"))


def PromoteAllDivs(old_semester, old_year=current_year):
for div in Div.objects.filter(semester=old_semester, calendar_year=old_year):
if len(div.division) <= 2:
PromoteDiv(str(div), old_year=old_year, old_semester=old_semester, with_pracs=False)


def SAPDump(path, div_name, overwrite=False, reverse_names=False, classteacher=None):
yearname, division = div_name.split("_")
year = Div.yearnameToYear(yearname)
Expand All @@ -22,20 +67,20 @@ def SAPDump(path, div_name, overwrite=False, reverse_names=False, classteacher=N
elif date.today().month > 6:
semester = year * 2 - 1

div_exists = Div.objects.filter(semester=semester, calendar_year=date.today().year, division=division).exists()
div_exists = Div.objects.filter(semester=semester, calendar_year=current_year, division=division).exists()
if div_exists and not overwrite:
raise Exception("Div already exists, set overwrite to True to overwrite")
elif div_exists:
div = Div.objects.get(semester=semester, calendar_year=date.today().year, division=division)
div = Div.objects.get(semester=semester, calendar_year=current_year, division=division)
else:
if classteacher:
names = classteacher.strip().split(' ')
teacher = Teacher.objects.get(user=AppUser.objects.get(first_name=names[0], last_name=names[1]))
div = Div.objects.create(semester=semester, calendar_year=date.today().year, division=division)
div = Div.objects.create(semester=semester, calendar_year=current_year, division=division)
div.classteacher = teacher
div.save()
else:
div = Div.objects.create(semester=semester, calendar_year=date.today().year, division=division)
div = Div.objects.create(semester=semester, calendar_year=current_year, division=division)

with open(path, 'r') as csvFile:
reader = csv.reader(csvFile)
Expand Down