Ejemplo n.º 1
0
def index(request):
    if request.user.is_authenticated:
        Lecturers_list = list(Lecturers.objects.values())
        lec_details = []
        rownumber = 1
        for lec_row in Lecturers_list:
            lec_row['row'] = rownumber
            lec_row['facultyLec'] = Functions.getSingleValueByCode(
                Faculty, str(lec_row['facultyLec_id']))
            lec_row['departmentLec'] = Functions.getSingleValueByCode(
                Department, str(lec_row['departmentLec_id']))
            lec_row['cousesTaken'] = Functions.getCourseTakenCount(
                Course, str(lec_row['code']))
            lec_row['priorityNumber'] = lec_row[
                'priorityNumber_id']  #staffTypes.objects.get(id=lec_row['priorityNumber_id']).type
            lec_details.append(lec_row)
            rownumber += 1

        context = {
            'lecturers': Lecturers_list,
            'maximumpriority': Functions.getMaxPriority() - 1,
            'pagedata': {
                'pageicon': 'teach',
                'pagetitle': 'Lecturers Management',
            }
        }
        return render(request, 'admin/lecturer/index.html', context)
    else:
        return redirect('../login')
Ejemplo n.º 2
0
def index(request):
    if request.user.is_authenticated:
        reg_list = list(Enrolment.objects.values())
        reg_details = []
        rownumber = 1
        for reg in reg_list:
            reg['row'] = rownumber
            reg['course_code'] = Functions.getSingleValueByCode(Course, reg['course_code_id'])
            reg['department'] = Functions.getSingleValueByCode(Department, reg['department_id'])
            reg['semesterType'] = Functions.getSemesterName(reg['semesterType'])
            reg_details.append(reg)
            rownumber += 1


        context = {
            'reg_details': reg_details,
            'idnum': 0,
            'pagedata':{
                'pageicon':'table-row-plus-before',
                'pagetitle':'Student Enrolments',
            }
        }
        return render(request, 'admin/registration/index.html', context)
    else:
        return redirect('../login')
Ejemplo n.º 3
0
def index(request):
    if request.user.is_authenticated:
        department_list = list(Department.objects.values())

        dpt_details = []
        rownumber = 1
        for dpt_row in department_list:
            dpt_row['row'] = rownumber
            dpt_row['facutly_name'] = Functions.getSingleValueByCode(
                Faculty, str(dpt_row['faculty_id']))
            dpt_row[
                'officer'] = '-'  #Functions.getSingleValueByCode(Faculty, str(dpt_row['officer']))
            dpt_details.append(dpt_row)
            rownumber += 1

        context = {
            'department_list': dpt_details,
            'idnum': 0,
            'pagedata': {
                'pageicon': 'school',
                'pagetitle': 'Departments Management',
            }
        }
        return render(request, 'admin/department/index.html', context)
    else:
        return redirect('../login')