currently i am getting an array from database,the code is in the following, if id do not exist variable b will render an empty array. at this time, i would like to check if this array is empty means the id is not exist in my Booking1 table. How should i express this " if empty " concept in python?
Expand|Select|Wrap|Line Numbers
- def confirmUp(request):
- q=request.session['BK_id']
- b=Booking1.objects.filter(id__exact=q)
- if b=empty
- return HttpResponseRedirect("/Notexist.html/")
- else:
- return render_to_response('proceed.html',{'b': b})