From 059a274aa96ced872156806936f887969980dda6 Mon Sep 17 00:00:00 2001 From: Elliot Smith Date: Fri, 15 Jan 2016 13:01:03 +0200 Subject: bitbake: toastergui: fix error and warning counts for builds The error and warning counts displayed for builds were counts of the errors and warnings objects associated with a build. Because these values were being derived on the fly, it was not possible to sort by them. Previously, the 3rd party django-aggregate-if library was used to add aggregate fields to Build objects and should then have been used to populate the "all builds" and "project builds" tables. However, at some point the templates had changed so that the error and warning counts were coming from the properties on the Build model and not from these aggregates. This meant that it was not possible to sort by these fields. Django 1.8 supports conditional aggregates in annotation fields on querysets. This means we can remove django-aggregate-if, use the new Django 1.8 feature to derive errors_no and warnings_no fields as annotations, then use those annotation fields in the templates. This makes the "builds" tables sortable again. [YOCTO #8738] (Bitbake rev: 9be7c5c18b325f6ed40bc431ac408db242007eb1) Signed-off-by: Elliot Smith Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastermain/settings.py | 9 --------- 1 file changed, 9 deletions(-) (limited to 'bitbake/lib/toaster/toastermain/settings.py') diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index 74103f3063..c4f3d6bfff 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py @@ -399,12 +399,3 @@ class InvalidString(str): "Undefined variable or unknown value for: \"%s\"" % other) TEMPLATE_STRING_IF_INVALID = InvalidString("%s") - -import sys -sys.path.append( - os.path.join( - os.path.join( - os.path.dirname(os.path.dirname(os.path.abspath(__file__))), - "contrib"), - "django-aggregate-if-master") - ) -- cgit v1.2.3-54-g00ecf