From 2de01a68eb6a9ca74384957c674928944c235269 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Mon, 18 May 2015 20:08:28 +0100 Subject: bitbake: toaster: Port layerdetails to ToasterTables This ports the layerdetails page to using ToasterTables Also some whitespace and strict clean ups in the existing layerdetails js and html template. (Bitbake rev: 8ce35f81631e31539aeb82f8a85abbb3312e5097) Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/widgets.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'bitbake/lib/toaster/toastergui/widgets.py') diff --git a/bitbake/lib/toaster/toastergui/widgets.py b/bitbake/lib/toaster/toastergui/widgets.py index 8d449193af..b5dfbbc039 100644 --- a/bitbake/lib/toaster/toastergui/widgets.py +++ b/bitbake/lib/toaster/toastergui/widgets.py @@ -26,7 +26,7 @@ from django.core import serializers from django.core.cache import cache from django.core.paginator import Paginator, EmptyPage from django.db.models import Q -from orm.models import Project, ProjectLayer +from orm.models import Project, ProjectLayer, Layer_Version from django.template import Context, Template from django.core.serializers.json import DjangoJSONEncoder from django.core.exceptions import FieldError @@ -43,9 +43,13 @@ class ToasterTemplateView(TemplateView): def get_context_data(self, **kwargs): context = super(ToasterTemplateView, self).get_context_data(**kwargs) if 'pid' in kwargs: - context['project'] = Project.objects.get(pk=kwargs['pid']) + context['project'] = Project.objects.get(pk=kwargs['pid']) + + context['projectlayers'] = map(lambda prjlayer: prjlayer.layercommit.id, ProjectLayer.objects.filter(project=context['project'])) + + if 'layerid' in kwargs: + context['layerversion'] = Layer_Version.objects.get(pk=kwargs['layerid']) - context['projectlayers'] = map(lambda prjlayer: prjlayer.layercommit.id, ProjectLayer.objects.filter(project=context['project'])) return context @@ -269,13 +273,6 @@ class ToasterTable(View): 'rows' : [], } - # Flatten all the fields we will need into one list - fields = [] - for col in self.columns: - if type(col['field_name']) is list: - fields.extend(col['field_name']) - else: - fields.append(col['field_name']) try: for row in page.object_list: -- cgit v1.2.3-54-g00ecf