def ingredients(request): """Returns the burger options, ingredients, pricing enz.""" if request.method == "POST": ingredients = json.loads(request.POST['ingredients']) Ingredient.set_all(ingredients) return redirect("/ingredients") # Respond to a normal call return render(request, "ingredients.html")
def ingredients_list(request): # Respond to a ajax call ingredients = Ingredient.get_all() return HttpResponse(json.dumps(ingredients),mimetype='application/json')