diff options
author | Michael Wood <michael.g.wood@intel.com> | 2015-05-18 20:08:28 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-05-29 11:59:45 +0100 |
commit | 2de01a68eb6a9ca74384957c674928944c235269 (patch) | |
tree | 7dbe5a8a2a169dac697bed032263c624e9c2be7e /bitbake/lib/toaster/toastergui/widgets.py | |
parent | a0ea663b83ecf5f286844420b071101feefc3d22 (diff) | |
download | poky-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.py | 17 |
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 | |||
26 | from django.core.cache import cache | 26 | from django.core.cache import cache |
27 | from django.core.paginator import Paginator, EmptyPage | 27 | from django.core.paginator import Paginator, EmptyPage |
28 | from django.db.models import Q | 28 | from django.db.models import Q |
29 | from orm.models import Project, ProjectLayer | 29 | from orm.models import Project, ProjectLayer, Layer_Version |
30 | from django.template import Context, Template | 30 | from django.template import Context, Template |
31 | from django.core.serializers.json import DjangoJSONEncoder | 31 | from django.core.serializers.json import DjangoJSONEncoder |
32 | from django.core.exceptions import FieldError | 32 | from 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: |