hi
currently i am doing car booking website. once customer booked car with us, we will give customer the booking id, thus if they would like to update or cancel, they need to type in their respective booking id. currently i am looping through all the id in my Booking1 table and check if there is any id match with the id post over from user. my code of update is in the following:
[code=python]
def confirmUp(reque st):
Array=[]
q=request.sessi on['BK_id']
uID=request.use r.id
print uID
for i in Booking1.object s.all():
if i.id == q:
ba=Booking1.obj ects.get(id=q)
print ba.id
print "LLLLLLLLLLLLLL LL"
Array.append(ba )"""
return render_to_respo nse('proceed.ht ml',{'ba': ba })
else:
return HttpResponseRed irect("/Notexist.html/")
[/code]
but it seems never go through if statement. and i have print value of p and the id in my Booking1 table. it is the same value and i am wondering why they do not go into my if statement, i believe my equal operator"==" should be used correct. can anyone help me with this. thanks in advance :)
it is a bit urgent at the moment, as project timeline is running out. thanks :)
currently i am doing car booking website. once customer booked car with us, we will give customer the booking id, thus if they would like to update or cancel, they need to type in their respective booking id. currently i am looping through all the id in my Booking1 table and check if there is any id match with the id post over from user. my code of update is in the following:
[code=python]
def confirmUp(reque st):
Array=[]
q=request.sessi on['BK_id']
uID=request.use r.id
print uID
for i in Booking1.object s.all():
if i.id == q:
ba=Booking1.obj ects.get(id=q)
print ba.id
print "LLLLLLLLLLLLLL LL"
Array.append(ba )"""
return render_to_respo nse('proceed.ht ml',{'ba': ba })
else:
return HttpResponseRed irect("/Notexist.html/")
[/code]
but it seems never go through if statement. and i have print value of p and the id in my Booking1 table. it is the same value and i am wondering why they do not go into my if statement, i believe my equal operator"==" should be used correct. can anyone help me with this. thanks in advance :)
it is a bit urgent at the moment, as project timeline is running out. thanks :)
Comment