def showIndex(request): res = returnAddress() page_no = request.GET.get("pageno",1) data = FoodItemsModel.objects.all() p = Paginator(data, 3) if page_no: page = p.page(page_no) else: page = p.page(1) return render(request, "customer/index.html", {"address":res[0], "city":res[1], "food":page})
def customer_menu(request): customer_details = CustomerRegistrationModel.objects.get(id=request.session["customer_id"]) res = returnAddress() page_no = request.GET.get("pageno", 1) data = FoodItemsModel.objects.all() p = Paginator(data, 3) if page_no: page = p.page(page_no) else: page = p.page(1) return render(request,"customer/menu.html",{"customer_details": customer_details,"address":res[0], "city":res[1], "food":page})