summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/widgets.py
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-05-18 20:08:28 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-29 11:59:45 +0100
commit2de01a68eb6a9ca74384957c674928944c235269 (patch)
tree7dbe5a8a2a169dac697bed032263c624e9c2be7e /bitbake/lib/toaster/toastergui/widgets.py
parenta0ea663b83ecf5f286844420b071101feefc3d22 (diff)
downloadpoky-2de01a68eb6a9ca74384957c674928944c235269.tar.gz
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 <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/widgets.py')
-rw-r--r--bitbake/lib/toaster/toastergui/widgets.py17
1 files changed, 7 insertions, 10 deletions
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
26from django.core.cache import cache 26from django.core.cache import cache
27from django.core.paginator import Paginator, EmptyPage 27from django.core.paginator import Paginator, EmptyPage
28from django.db.models import Q 28from django.db.models import Q
29from orm.models import Project, ProjectLayer 29from orm.models import Project, ProjectLayer, Layer_Version
30from django.template import Context, Template 30from django.template import Context, Template
31from django.core.serializers.json import DjangoJSONEncoder 31from django.core.serializers.json import DjangoJSONEncoder
32from django.core.exceptions import FieldError 32from django.core.exceptions import FieldError
@@ -43,9 +43,13 @@ class ToasterTemplateView(TemplateView):
43 def get_context_data(self, **kwargs): 43 def get_context_data(self, **kwargs):
44 context = super(ToasterTemplateView, self).get_context_data(**kwargs) 44 context = super(ToasterTemplateView, self).get_context_data(**kwargs)
45 if 'pid' in kwargs: 45 if 'pid' in kwargs:
46 context['project'] = Project.objects.get(pk=kwargs['pid']) 46 context['project'] = Project.objects.get(pk=kwargs['pid'])
47
48 context['projectlayers'] = map(lambda prjlayer: prjlayer.layercommit.id, ProjectLayer.objects.filter(project=context['project']))
49
50 if 'layerid' in kwargs:
51 context['layerversion'] = Layer_Version.objects.get(pk=kwargs['layerid'])
47 52
48 context['projectlayers'] = map(lambda prjlayer: prjlayer.layercommit.id, ProjectLayer.objects.filter(project=context['project']))
49 return context 53 return context
50 54
51 55
@@ -269,13 +273,6 @@ class ToasterTable(View):
269 'rows' : [], 273 'rows' : [],
270 } 274 }
271 275
272 # Flatten all the fields we will need into one list
273 fields = []
274 for col in self.columns:
275 if type(col['field_name']) is list:
276 fields.extend(col['field_name'])
277 else:
278 fields.append(col['field_name'])
279 276
280 try: 277 try:
281 for row in page.object_list: 278 for row in page.object_list: