def editquestion(request, subid, qid): uid = request.session['st'] qry = "select * from staff_data where uid='" + uid + "'" data = dbconnection.selectdata(qry) qry = "select * from qn_data where id='" + qid + "'" data1 = dbconnection.selectdata(qry) if request.method == 'POST': qn = request.POST.get('qn') qry = "update qn_data set qn='" + qn + "' where id='" + qid + "'" dbconnection.updatedata(qry) return HttpResponseRedirect("http://127.0.0.1:8000/addquestion/" + subid) return render(request, "staff/editquestion.html", { 'data': data, 'subjid': subid, 'qn': data1 })
def denyanswer(request, qid, subid): qry = "update answr_data set st=2 where id='" + qid + "'" dbconnection.updatedata(qry) return HttpResponseRedirect("http://127.0.0.1:8000/answers/" + subid)