summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-03-13 15:22:32 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-21 00:00:28 +0000
commit1f1230c792eeeef8f137430c32f26fb902c02f50 (patch)
tree8e381e31e2134b7909628a1254cbf2e3859c000e /bitbake
parent3c5e2917604315775eebe7e62a560a853e5b1c58 (diff)
downloadast2050-yocto-poky-1f1230c792eeeef8f137430c32f26fb902c02f50.zip
ast2050-yocto-poky-1f1230c792eeeef8f137430c32f26fb902c02f50.tar.gz
bitbake: toaster: tasks trigger the select related tables before ordering
In two of the cases the data is changed from a QuerySet to a sorted list so we aren't able to use the QuerySet api at this point, moving it before the data type is changed fixes this. [YOCTO #7404] (Bitbake rev: 484797744dbe421dfeea52e9428ba63b44f1ed88) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 26c8760..ea47d96 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -877,7 +877,10 @@ def tasks_common(request, build_id, variant, task_anchor):
return _redirect_parameters( variant, request.GET, mandatory_parameters, build_id = build_id)
(filter_string, search_term, ordering_string) = _search_tuple(request, Task)
queryset_all = Task.objects.filter(build=build_id).exclude(order__isnull=True).exclude(outcome=Task.OUTCOME_NA)
+ queryset_all = queryset_all.select_related("recipe", "build")
+
queryset_with_search = _get_queryset(Task, queryset_all, None , search_term, ordering_string, 'order')
+
if ordering_string.startswith('outcome'):
queryset = _get_queryset(Task, queryset_all, filter_string, search_term, 'order:+', 'order')
queryset = sorted(queryset, key=lambda ur: (ur.outcome_text), reverse=ordering_string.endswith('-'))
@@ -887,7 +890,6 @@ def tasks_common(request, build_id, variant, task_anchor):
else:
queryset = _get_queryset(Task, queryset_all, filter_string, search_term, ordering_string, 'order')
- queryset = queryset.select_related("recipe", "build")
# compute the anchor's page
if anchor:
OpenPOWER on IntegriCloud