basic recipe view

This commit is contained in:
vabene1111
2019-11-14 01:13:42 +01:00
parent b725ee6b6a
commit eb10473e63
3 changed files with 19 additions and 3 deletions

View File

@@ -22,7 +22,9 @@ def index(request):
@login_required
def recipe_view(request, pk):
recipe = get_object_or_404(Recipe, pk=pk)
return render(request, 'recipe_view.html', {'recipe': recipe})
ingredients = RecipeIngredients.objects.filter(recipe=recipe)
return render(request, 'recipe_view.html', {'recipe': recipe, 'ingredients': ingredients})
def test(request):