Skip to content
Merged
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
14 changes: 11 additions & 3 deletions FusionIIIT/applications/academic_information/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ def random_algo(batch,sem,year,course_slot, programme_type) :
for course in unique_course :
max_seats[course] = Course.objects.get(id=course).max_seats
total_seats+=max_seats[course]
seats_alloted[course] = 0
seats_alloted[course] = FinalRegistration.objects.filter(
course_id_id=course,
semester_id__semester_no=sem,
student_id__batch=batch,
student_id__batch_id__curriculum__programme__category=programme_type,
).count()
present_priority[course] = []
next_priority[course] = []

Expand Down Expand Up @@ -86,8 +91,11 @@ def random_algo(batch,sem,year,course_slot, programme_type) :
seats_alloted[course] += 1
rem-=1
else :
next = InitialRegistration.objects.get(Q(student_id__id__id = random_student_selected[0]) & Q( course_slot_id__name = course_slot ) & Q(semester_id__semester_no = sem) & Q(student_id__batch = batch) & Q(priority=p_priority+1) & Q(student_id__batch_id__curriculum__programme__category=programme_type))
next_priority[next.course_id.id].append([next.student_id.id.id,next.course_slot_id.id])
next = InitialRegistration.objects.filter(Q(student_id__id__id = random_student_selected[0]) & Q( course_slot_id__name = course_slot ) & Q(semester_id__semester_no = sem) & Q(student_id__batch = batch) & Q(priority=p_priority+1) & Q(student_id__batch_id__curriculum__programme__category=programme_type)).first()
if next is not None :
next_priority[next.course_id.id].append([next.student_id.id.id,next.course_slot_id.id])
else :
rem-=1
p_priority+=1
present_priority = next_priority
next_priority = {course : [] for course in unique_course}
Expand Down
Loading