mirror of
https://git.yoctoproject.org/poky
synced 2026-05-08 17:19:20 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
84a294edde
commit
3b1bb2dfff
@@ -1266,43 +1266,15 @@ def recipes(request, build_id):
|
|||||||
def configuration(request, build_id):
|
def configuration(request, build_id):
|
||||||
template = 'configuration.html'
|
template = 'configuration.html'
|
||||||
|
|
||||||
variables = Variable.objects.filter(build=build_id)
|
var_names = ('BB_VERSION', 'BUILD_SYS', 'NATIVELSBSTRING', 'TARGET_SYS',
|
||||||
|
'MACHINE', 'DISTRO', 'DISTRO_VERSION', 'TUNE_FEATURES', 'TARGET_FPU')
|
||||||
def _get_variable_or_empty(variable_name):
|
context = dict(Variable.objects.filter(build=build_id, variable_name__in=var_names)\
|
||||||
from django.core.exceptions import ObjectDoesNotExist
|
.values_list('variable_name', 'variable_value'))
|
||||||
try:
|
context.update({'objectname': 'configuration',
|
||||||
return variables.get(variable_name=variable_name).variable_value
|
'object_search_display':'variables',
|
||||||
except ObjectDoesNotExist:
|
'filter_search_display':'variables',
|
||||||
return ''
|
'build': Build.objects.get(pk=build_id),
|
||||||
|
'targets': Target.objects.filter(build=build_id)})
|
||||||
BB_VERSION=_get_variable_or_empty(variable_name='BB_VERSION')
|
|
||||||
BUILD_SYS=_get_variable_or_empty(variable_name='BUILD_SYS')
|
|
||||||
NATIVELSBSTRING=_get_variable_or_empty(variable_name='NATIVELSBSTRING')
|
|
||||||
TARGET_SYS=_get_variable_or_empty(variable_name='TARGET_SYS')
|
|
||||||
MACHINE=_get_variable_or_empty(variable_name='MACHINE')
|
|
||||||
DISTRO=_get_variable_or_empty(variable_name='DISTRO')
|
|
||||||
DISTRO_VERSION=_get_variable_or_empty(variable_name='DISTRO_VERSION')
|
|
||||||
TUNE_FEATURES=_get_variable_or_empty(variable_name='TUNE_FEATURES')
|
|
||||||
TARGET_FPU=_get_variable_or_empty(variable_name='TARGET_FPU')
|
|
||||||
|
|
||||||
targets = Target.objects.filter(build=build_id)
|
|
||||||
|
|
||||||
context = {
|
|
||||||
'objectname': 'configuration',
|
|
||||||
'object_search_display':'variables',
|
|
||||||
'filter_search_display':'variables',
|
|
||||||
'build': Build.objects.get(pk=build_id),
|
|
||||||
'BB_VERSION':BB_VERSION,
|
|
||||||
'BUILD_SYS':BUILD_SYS,
|
|
||||||
'NATIVELSBSTRING':NATIVELSBSTRING,
|
|
||||||
'TARGET_SYS':TARGET_SYS,
|
|
||||||
'MACHINE':MACHINE,
|
|
||||||
'DISTRO':DISTRO,
|
|
||||||
'DISTRO_VERSION':DISTRO_VERSION,
|
|
||||||
'TUNE_FEATURES':TUNE_FEATURES,
|
|
||||||
'TARGET_FPU':TARGET_FPU,
|
|
||||||
'targets':targets,
|
|
||||||
}
|
|
||||||
return render(request, template, context)
|
return render(request, template, context)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user