Esempio n. 1
0
def IndividualStudentForStudentLogin(request):
    if request.user.is_authenticated:
        if request.user.is_student:
            now = timezone.now()
            #users = User.objects.all()
            try:
                users = MarkAttendanceCode.getCumulativeAttendanceOfAStudent(
                    stuUsrname)
            except IndexError:
                return render(request, 'classroom/None.html')
            print(users)
            return render(
                request,
                'classroom/IndividualStudentDetailsForStudentLogin.html',
                {'users': users})
        else:
            return render(request, 'classroom/NotAuthenticated.html')
Esempio n. 2
0
def IndividualStudent(request):
    now = timezone.now()
    if request.method == 'GET':
        form = PostForm()
    else:
        form = PostForm(request.POST)
        studentID = form['classID'].value()
        py_obj = test_code()
        py_obj.code1(studentID)
    try:
        users = MarkAttendanceCode.getCumulativeAttendanceOfAStudent(studentID)
    except IndexError:
        return render(request, 'classroom/None.html',
                      {'message': 'Enter Valid StudentId'})
    print(users)
    #users = User.objects.filter(username = sid1)
    if (bool(users)):
        return render(request, 'classroom/IndividualStudentDetails.html', {
            'users': users,
            'sid': studentID
        })
    else:
        return render(request, 'classroom/None.html', {'users': users})