From 4aa29836812ba2a18fa8d0e90582fa667732f1a8 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sat, 2 May 2020 23:05:36 +0200 Subject: [PATCH] order recipe ingredients --- cookbook/views/edit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/views/edit.py b/cookbook/views/edit.py index af7e91e19..20fb40c4f 100644 --- a/cookbook/views/edit.py +++ b/cookbook/views/edit.py @@ -126,7 +126,7 @@ def internal_recipe_update(request, pk): else: form = InternalRecipeForm(instance=recipe_instance) - ingredients = RecipeIngredient.objects.select_related('unit__name', 'ingredient__name').filter(recipe=recipe_instance).values('ingredient__name', 'unit__name', 'amount', 'note') + ingredients = RecipeIngredient.objects.select_related('unit__name', 'ingredient__name').filter(recipe=recipe_instance).values('ingredient__name', 'unit__name', 'amount', 'note').order_by('id') return render(request, 'forms/edit_internal_recipe.html', {'form': form, 'ingredients': json.dumps(list(ingredients)),