pass ingredients to template
This commit is contained in:
parent
8eca629410
commit
ec23e431ea
@ -8,7 +8,7 @@ from django.utils.translation import gettext as _
|
|||||||
from django.views.generic import UpdateView, DeleteView
|
from django.views.generic import UpdateView, DeleteView
|
||||||
|
|
||||||
from cookbook.forms import ExternalRecipeForm, KeywordForm, StorageForm, SyncForm, InternalRecipeForm, CommentForm
|
from cookbook.forms import ExternalRecipeForm, KeywordForm, StorageForm, SyncForm, InternalRecipeForm, CommentForm
|
||||||
from cookbook.models import Recipe, Sync, Keyword, RecipeImport, Storage, Comment
|
from cookbook.models import Recipe, Sync, Keyword, RecipeImport, Storage, Comment, RecipeIngredients
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@ -52,8 +52,10 @@ def internal_recipe_update(request, pk):
|
|||||||
else:
|
else:
|
||||||
form = InternalRecipeForm(instance=recipe_instance)
|
form = InternalRecipeForm(instance=recipe_instance)
|
||||||
|
|
||||||
|
ingredients = RecipeIngredients.objects.filter(recipe=recipe_instance)
|
||||||
|
|
||||||
return render(request, 'forms/edit_internal_recipe.html',
|
return render(request, 'forms/edit_internal_recipe.html',
|
||||||
{'form': form, 'view_url': reverse('view_recipe', args=[pk])})
|
{'form': form, 'ingredients': ingredients, 'view_url': reverse('view_recipe', args=[pk])})
|
||||||
|
|
||||||
|
|
||||||
class SyncUpdate(LoginRequiredMixin, UpdateView):
|
class SyncUpdate(LoginRequiredMixin, UpdateView):
|
||||||
|
Loading…
Reference in New Issue
Block a user