summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-05-02 18:50:34 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-12 12:14:12 +0100
commit3b1bb2dfffe35a894bc08bb6c8caa24f4ac1db47 (patch)
tree2788b0cff6a14eaba1e09dd408983fc1f82a747f /bitbake
parent84a294eddee8405d9133f8c365e9589dd254197d (diff)
downloadpoky-3b1bb2dfffe35a894bc08bb6c8caa24f4ac1db47.tar.gz
bitbake: toastergui: decrease load time for configuration page
Used __in field lookup for QuerySet to get build variables faster. [YOCTO #6691] (Bitbake rev: 222e21d2fc3dc67449e582d983e11ea927e3eaef) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py46
1 files changed, 9 insertions, 37 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 7e90926559..e296cf6de3 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -1266,43 +1266,15 @@ def recipes(request, build_id):
1266def configuration(request, build_id): 1266def configuration(request, build_id):
1267 template = 'configuration.html' 1267 template = 'configuration.html'
1268 1268
1269 variables = Variable.objects.filter(build=build_id) 1269 var_names = ('BB_VERSION', 'BUILD_SYS', 'NATIVELSBSTRING', 'TARGET_SYS',
1270 1270 'MACHINE', 'DISTRO', 'DISTRO_VERSION', 'TUNE_FEATURES', 'TARGET_FPU')
1271 def _get_variable_or_empty(variable_name): 1271 context = dict(Variable.objects.filter(build=build_id, variable_name__in=var_names)\
1272 from django.core.exceptions import ObjectDoesNotExist 1272 .values_list('variable_name', 'variable_value'))
1273 try: 1273 context.update({'objectname': 'configuration',
1274 return variables.get(variable_name=variable_name).variable_value 1274 'object_search_display':'variables',
1275 except ObjectDoesNotExist: 1275 'filter_search_display':'variables',
1276 return '' 1276 'build': Build.objects.get(pk=build_id),
1277 1277 'targets': Target.objects.filter(build=build_id)})
1278 BB_VERSION=_get_variable_or_empty(variable_name='BB_VERSION')
1279 BUILD_SYS=_get_variable_or_empty(variable_name='BUILD_SYS')
1280 NATIVELSBSTRING=_get_variable_or_empty(variable_name='NATIVELSBSTRING')
1281 TARGET_SYS=_get_variable_or_empty(variable_name='TARGET_SYS')
1282 MACHINE=_get_variable_or_empty(variable_name='MACHINE')
1283 DISTRO=_get_variable_or_empty(variable_name='DISTRO')
1284 DISTRO_VERSION=_get_variable_or_empty(variable_name='DISTRO_VERSION')
1285 TUNE_FEATURES=_get_variable_or_empty(variable_name='TUNE_FEATURES')
1286 TARGET_FPU=_get_variable_or_empty(variable_name='TARGET_FPU')
1287
1288 targets = Target.objects.filter(build=build_id)
1289
1290 context = {
1291 'objectname': 'configuration',
1292 'object_search_display':'variables',
1293 'filter_search_display':'variables',
1294 'build': Build.objects.get(pk=build_id),
1295 'BB_VERSION':BB_VERSION,
1296 'BUILD_SYS':BUILD_SYS,
1297 'NATIVELSBSTRING':NATIVELSBSTRING,
1298 'TARGET_SYS':TARGET_SYS,
1299 'MACHINE':MACHINE,
1300 'DISTRO':DISTRO,
1301 'DISTRO_VERSION':DISTRO_VERSION,
1302 'TUNE_FEATURES':TUNE_FEATURES,
1303 'TARGET_FPU':TARGET_FPU,
1304 'targets':targets,
1305 }
1306 return render(request, template, context) 1278 return render(request, template, context)
1307 1279
1308 1280