def loadmobiles(request): user = request.COOKIES.get('username') mobiles = Mobiles.objects.all() mobiles = make_ratings(mobiles) params = {"user": user, "mobiles": mobiles} return render(request, 'GRSapp/loadMobiles.html', params)
def loadmobiles(request): user = request.COOKIES.get('username') if UsersModal.objects.filter(username=user): user = UsersModal.objects.get(username=user) mobiles = Mobiles.objects.all().order_by('-rating') mobiles = make_ratings(mobiles) params = {"user": user, "mobiles": mobiles} return render(request, 'GRSapp/loadMobiles.html', params)
def loadlaptops(request): user = request.COOKIES.get('username') if UsersModal.objects.filter(username=user): user = UsersModal.objects.get(username=user) laptops = Laptops.objects.all().order_by('-rating') laptops = make_ratings(laptops) params = {"user": user, "laptops": laptops} return render(request, 'GRSapp/loadLaptops.html', params)
def loadfridges(request): user = request.COOKIES.get('username') if UsersModal.objects.filter(username=user): user = UsersModal.objects.get(username=user) fridges = Refrigerator.objects.all().order_by('-rating') fridges = make_ratings(fridges) params = {"user": user, "fridges": fridges} return render(request, 'GRSapp/loadFridges.html', params)
def loadtelevisions(request): user = request.COOKIES.get('username') if UsersModal.objects.filter(username=user): user = UsersModal.objects.get(username=user) televisions = Television.objects.all().order_by('-rating') televisions = make_ratings(televisions) params = {"user": user, "televisions": televisions} return render(request, 'GRSapp/loadTelevisions.html', params)
def loadwashmachines(request): user = request.COOKIES.get('username') if UsersModal.objects.filter(username=user): user = UsersModal.objects.get(username=user) wms = WashingMachine.objects.all().order_by('-rating') wms = make_ratings(wms) params = {"user": user, "wms": wms} return render(request, 'GRSapp/loadWashmachines.html', params)
def loadkettles(request): user = request.COOKIES.get('username') if UsersModal.objects.filter(username=user): user = UsersModal.objects.get(username=user) kettles = Kettle.objects.all().order_by('-rating') kettles = make_ratings(kettles) params = {"user": user, "kettles": kettles} return render(request, 'GRSapp/loadKettles.html', params)
def loadpowerbanks(request): user = request.COOKIES.get('username') if UsersModal.objects.filter(username=user): user = UsersModal.objects.get(username=user) pbanks = Powerbank.objects.all().order_by('-rating') pbanks = make_ratings(pbanks) params = {"user": user, "pbanks": pbanks} return render(request, 'GRSapp/loadPowerbanks.html', params)
def loadcameras(request): user = request.COOKIES.get('username') if UsersModal.objects.filter(username=user): user = UsersModal.objects.get(username=user) cameras = Camera.objects.all().order_by('-rating') cameras = make_ratings(cameras) params = {"user": user, "cameras": cameras} return render(request, 'GRSapp/loadCameras.html', params)
def loadheadsets(request): user = request.COOKIES.get('username') if UsersModal.objects.filter(username=user): user = UsersModal.objects.get(username=user) headsets = HeadSet.objects.all().order_by('-rating') headsets = make_ratings(headsets) params = {"user": user, "headsets": headsets} return render(request, 'GRSapp/loadHeadsets.html', params)