Beispiel #1
0
def del_meal(request, meal):
	context = prepareContext(request)
	m = Meal.objects.get(id=meal)
	form = ConfirmDeleteForm(request.POST or None)
	if(form.is_valid()):
		m.delete()
		return redirect('cooking:meals')
	
	context['object'] = m
	context['noaction'] = reverse('cooking:meals')
	context['form'] = form
	context['pagetitle'] = 'Delete Meal'
	return render(request, 'single/confirmdelete.html', context)
Beispiel #2
0
def del_receipe(request, active_receipe):
	context = prepareContext(request)
	rec = Receipe.objects.get(id=active_receipe)
	form = ConfirmDeleteForm(request.POST or None)
	if(form.is_valid()):
		rec.delete()
		return redirect('cooking:receipes')
	
	context['object'] = rec
	context['noaction'] = reverse('cooking:receipes')
	context['form'] = form
	context['pagetitle'] = 'Delete Receipe'
	return render(request, 'single/confirmdelete.html', context)
Beispiel #3
0
def del_receipe(request, active_receipe):
    context = prepareContext(request)
    rec = Receipe.objects.get(id=active_receipe)
    form = ConfirmDeleteForm(request.POST or None)
    if (form.is_valid()):
        rec.delete()
        return redirect('cooking:receipes')

    context['object'] = rec
    context['noaction'] = reverse('cooking:receipes')
    context['form'] = form
    context['pagetitle'] = 'Delete Receipe'
    return render(request, 'single/confirmdelete.html', context)
Beispiel #4
0
def del_meal(request, meal):
    context = prepareContext(request)
    m = Meal.objects.get(id=meal)
    form = ConfirmDeleteForm(request.POST or None)
    if (form.is_valid()):
        m.delete()
        return redirect('cooking:meals')

    context['object'] = m
    context['noaction'] = reverse('cooking:meals')
    context['form'] = form
    context['pagetitle'] = 'Delete Meal'
    return render(request, 'single/confirmdelete.html', context)
Beispiel #5
0
def del_ingredient(request, ingredient):
	context = prepareContext(request)
	ing = Ingredient.objects.get(id=ingredient)
	form = ConfirmDeleteForm(request.POST or None)
	if(form.is_valid()):
		ing.delete()
		return redirect('cooking:ingredients')
	
	context['object'] = ing
	context['noaction'] = reverse('cooking:ingredients')
	context['form'] = form
	context['pagetitle'] = 'Delete Ingredient'
	return render(request, 'single/confirmdelete.html', context)
Beispiel #6
0
def del_ingredient(request, ingredient):
    context = prepareContext(request)
    ing = Ingredient.objects.get(id=ingredient)
    form = ConfirmDeleteForm(request.POST or None)
    if (form.is_valid()):
        ing.delete()
        return redirect('cooking:ingredients')

    context['object'] = ing
    context['noaction'] = reverse('cooking:ingredients')
    context['form'] = form
    context['pagetitle'] = 'Delete Ingredient'
    return render(request, 'single/confirmdelete.html', context)