Пример #1
0
def add_session_save(request):
    if request.method == 'POST':
        session_start_year = request.POST.get('session_start')
        session_end_year = request.POST.get('session_end')
        sessionyear = SessionYearModel(session_start_year=session_start_year,
                                       session_end_year=session_end_year)
        sessionyear.save()
        messages.success(request, 'Successfully Added Session')
        return HttpResponseRedirect('/manage_session')

    else:
        messages.error(request, 'Failed to Add Session')
        return HttpResponseRedirect(reverse('manage_session'))
Пример #2
0
def add_session_save(request):
    if request.method != "POST":
        return HttpResponseRedirect(reverse("manage_session"))
    else:
        session_start_year = request.POST.get("session_start")
        session_end_year = request.POST.get("session_end")

        try:
            sessionyear = SessionYearModel(session_start_year=session_start_year, session_end_year=session_end_year)
            sessionyear.save()
            messages.success(request,"Successfully Added Session")
            return HttpResponseRedirect(reverse("manage_session"))
        except:
            messages.error(request,"Failed to Added Session")
            return HttpResponseRedirect(reverse("manage_session"))
def add_session_save(request):
    if request.method != "POST":
        messages.error(request, "Invalid Method")
        return redirect('add_course')
    else:
        session_start_year = request.POST.get('session_start_year')
        session_end_year = request.POST.get('session_end_year')

        try:
            sessionyear = SessionYearModel(session_start_year=session_start_year, session_end_year=session_end_year)
            sessionyear.save()
            messages.success(request, "Session Year added Successfully!")
            return redirect("add_session")
        except:
            messages.error(request, "Failed to Add Session Year")
            return redirect("add_session")
def add_session_save(request):
    if request.method != "POST":
        return HttpResponseRedirect(reverse("manage_session"))
    else:
        session_start_year = request.POST.get("session_start")
        session_start_end = request.POST.get("session_end")
        try:
            sessionyear = SessionYearModel(
                session_start_year=session_start_year,
                session_start_end=session_start_end)
            sessionyear.save()
            messages.success(request, "Satisfactorio Añadido Session")
            return HttpResponseRedirect(reverse("manage_session"))
        except:
            messages.error(request, "Falla al añadir Session")
            return HttpResponseRedirect(reverse("manage_session"))
Пример #5
0
def add_session_save(request):
    if request.method != "POST":
        messages.error(request, "Invalid Method")
        return redirect('add_course')
    else:
        session_start_year = request.POST.get('session_start_year')
        session_end_year = request.POST.get('session_end_year')

        try:
            sessionyear = SessionYearModel(
                session_start_year=session_start_year,
                session_end_year=session_end_year)
            sessionyear.save()
            messages.success(request, "تم بنجاح إضافة الجلسة")
            return redirect("add_session")
        except:
            messages.error(request, "فشل في إضافة الجلسة")
            return redirect("add_session")
Пример #6
0
def add_session_save(request):
    if request.method != "POST":
        messages.error(request, "Invalid Method")
        return redirect('add_course')
    else:
        session_start_year = request.POST.get('session_start_year')
        session_end_year = request.POST.get('session_end_year')

        try:
            sessionyear = SessionYearModel(
                session_start_year=session_start_year,
                session_end_year=session_end_year)
            sessionyear.save()
            messages.success(request, "Sessiya İli Artırıldı!")
            return redirect("add_session")
        except:
            messages.error(request, "Sessiya İli Artırılarkən Xəta Baş Verdi")
            return redirect("add_session")