summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rw-r--r--bitbake/lib/toaster/toastergui/views.py24
1 files changed, 22 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 0f92caf56b..d323b37013 100644
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -19,13 +19,13 @@
19# with this program; if not, write to the Free Software Foundation, Inc., 19# with this program; if not, write to the Free Software Foundation, Inc.,
20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 21
22import operator 22import operator,re
23 23
24from django.db.models import Q, Sum 24from django.db.models import Q, Sum
25from django.shortcuts import render, redirect 25from django.shortcuts import render, redirect
26from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable 26from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable
27from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency 27from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency
28from orm.models import Target_Installed_Package, Target_Image_File 28from orm.models import Target_Installed_Package, Target_File, Target_Image_File
29from django.views.decorators.cache import cache_control 29from django.views.decorators.cache import cache_control
30from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger 30from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
31from django.http import HttpResponseBadRequest 31from django.http import HttpResponseBadRequest
@@ -231,6 +231,25 @@ def builds(request):
231 else: 231 else:
232 b.eta = 0 232 b.eta = 0
233 233
234 # set up list of fstypes for each build
235 fstypes_map = {};
236 for build in build_info:
237 targets = Target.objects.filter( build_id = build.id )
238 comma = "";
239 extensions = "";
240 for t in targets:
241 if ( not t.is_image ):
242 continue
243 tif = Target_Image_File.objects.filter( target_id = t.id )
244 for i in tif:
245 s=re.sub('.*tar.bz2', 'tar.bz2', i.file_name)
246 if s == i.file_name:
247 s=re.sub('.*\.', '', i.file_name)
248 if None == re.search(s,extensions):
249 extensions += comma + s
250 comma = ", "
251 fstypes_map[build.id]=extensions
252
234 # send the data to the template 253 # send the data to the template
235 context = { 254 context = {
236 # specific info for 255 # specific info for
@@ -238,6 +257,7 @@ def builds(request):
238 # TODO: common objects for all table views, adapt as needed 257 # TODO: common objects for all table views, adapt as needed
239 'objects' : build_info, 258 'objects' : build_info,
240 'objectname' : "builds", 259 'objectname' : "builds",
260 'fstypes' : fstypes_map,
241 'search_term' : search_term, 261 'search_term' : search_term,
242 'total_count' : queryset_with_search.count(), 262 'total_count' : queryset_with_search.count(),
243 # Specifies the display of columns for the table, appearance in "Edit columns" box, toggling default show/hide, and specifying filters for columns 263 # Specifies the display of columns for the table, appearance in "Edit columns" box, toggling default show/hide, and specifying filters for columns