[Toaster] [review-request][PATCH] bitbake: toaster: tasks trigger the select related tables before ordering
Damian, Alexandru
alexandru.damian at intel.com
Tue Mar 17 04:07:10 PDT 2015
Taken for submission,
Thank you,
Alex
On Fri, Mar 13, 2015 at 4:46 PM, Barros Pena, Belen <
belen.barros.pena at intel.com> wrote:
>
>
> On 13/03/2015 15:22, "Michael Wood" <michael.g.wood at intel.com> wrote:
>
> >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]
>
> This works for me.
>
> Thanks!
>
> Belén
>
> >
> >Signed-off-by: Michael Wood <michael.g.wood at intel.com>
> >---
> > bitbake/lib/toaster/toastergui/views.py | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> >diff --git a/bitbake/lib/toaster/toastergui/views.py
> >b/bitbake/lib/toaster/toastergui/views.py
> >index 8034cfc..6acd648 100755
> >--- a/bitbake/lib/toaster/toastergui/views.py
> >+++ b/bitbake/lib/toaster/toastergui/views.py
> >@@ -872,7 +872,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(ou
> >tcome=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('-'))
> >@@ -882,7 +885,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:
> >--
> >2.1.0
> >
> >--
> >_______________________________________________
> >toaster mailing list
> >toaster at yoctoproject.org
> >https://lists.yoctoproject.org/listinfo/toaster
>
> --
> _______________________________________________
> toaster mailing list
> toaster at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/toaster
>
--
Alex Damian
Yocto Project
SSG / OTC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/toaster/attachments/20150317/317740cd/attachment.html>
More information about the toaster
mailing list