summaryrefslogtreecommitdiffstats
path: root/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/toaster/toastergui/views.py')
-rwxr-xr-x[-rw-r--r--]lib/toaster/toastergui/views.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py
index 4622810cf..686cd5c8c 100644..100755
--- a/lib/toaster/toastergui/views.py
+++ b/lib/toaster/toastergui/views.py
@@ -1074,11 +1074,26 @@ def recipes(request, build_id):
recipes = _build_page_range(Paginator(queryset, request.GET.get('count', 100)),request.GET.get('page', 1))
+ # prefetch the forward and reverse recipe dependencies
+ deps = { }; revs = { }
+ queryset_dependency=Recipe_Dependency.objects.filter(recipe__layer_version__build_id = build_id)
+ for recipe in recipes:
+ deplist = [ ]
+ for recipe_dep in [x for x in queryset_dependency if x.recipe_id == recipe.id]:
+ deplist.append(recipe_dep)
+ deps[recipe.id] = deplist
+ revlist = [ ]
+ for recipe_dep in [x for x in queryset_dependency if x.depends_on_id == recipe.id]:
+ revlist.append(recipe_dep)
+ revs[recipe.id] = revlist
+
context = {
'objectname': 'recipes',
'build': Build.objects.filter(pk=build_id)[0],
'objects': recipes,
'default_orderby' : 'name:+',
+ 'recipe_deps' : deps,
+ 'recipe_revs' : revs,
'tablecols':[
{
'name':'Recipe',