def orders(request): if admin_authenticate(request) == False: return redirect(reverse('index')) context = get_orders(request) template = loader.get_template('store_admin/orders.html') return HttpResponse(template.render(context, request))
def page(request, alert=None): if admin_authenticate(request) == False: return redirect(reverse('index')) context = {'alert': alert} template = loader.get_template('store_admin/store_admin.html') return HttpResponse(template.render(context, request))
def adminFunc(request): admin_authenticate(request) if 'parameter' not in request.POST: context = False return context elif request.POST['parameter']: search_results = search(request, sparam=request.POST['parameter']) context = { 'search_results': search_results, } return context else: context = {} return context
def alter_page(request): if admin_authenticate(request) == False: return redirect(reverse('index')) context = get_product(request) if type(context) == bool: return redirect(reverse('admin_page')) template = loader.get_template('store_admin/alter.html') return HttpResponse(template.render(context, request))
def create(request): if admin_authenticate(request) == False: return redirect(reverse('index')) alert = create_product(request) return page(request, alert)