Beispiel #1
0
def addreceta(request):
	if request.method == "POST":
		form = RecetaForm(request.POST)
		if form.is_valid():
			receta = form.save()
			receta.save()
			return HttpResponseRedirect("/")
	else:
		form = RecetaForm()
	return render(request, 'recetas/add_receta.html', {'form': form})
Beispiel #2
0
def addreceta(request):
    if request.method == "POST":
        form = RecetaForm(request.POST)
        if form.is_valid():
            receta = form.save()
            receta.save()
            return HttpResponseRedirect("/")
    else:
        form = RecetaForm()
    return render(request, 'recetas/add_receta.html', {'form': form})