summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/tables.py
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-08-06 19:01:35 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-06 16:04:48 -0500
commitaf72d0fbb2d0f4d9aa29e124b3b4e216017f771d (patch)
treeecde1021451fcb2e2cc78729134441cb21a412e5 /bitbake/lib/toaster/toastergui/tables.py
parentda4c66385dc8bc80242664c365b180c9bbc98707 (diff)
downloadpoky-af72d0fbb2d0f4d9aa29e124b3b4e216017f771d.tar.gz
bitbake: toastergui: Move layerdetails view definition to the views.py
The layerdetails view definition was moved to tables though it isn't a table. We have a mechanism for the JSON response for this page so use this instead of a custom class. (Bitbake rev: b5100bfd4cb32a9b59b0554c6dbc3a4295da7d8e) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/tables.py')
-rw-r--r--bitbake/lib/toaster/toastergui/tables.py24
1 files changed, 1 insertions, 23 deletions
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py
index e4cbec193e..cf0e5ac6bb 100644
--- a/bitbake/lib/toaster/toastergui/tables.py
+++ b/bitbake/lib/toaster/toastergui/tables.py
@@ -19,7 +19,7 @@
19# with this program; if not, write to the Free Software Foundation, Inc., 19# with this program; if not, write to the Free Software Foundation, Inc.,
20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 21
22from toastergui.widgets import ToasterTable, ToasterTemplateView 22from toastergui.widgets import ToasterTable
23from orm.models import Recipe, ProjectLayer, Layer_Version, Machine, Project 23from orm.models import Recipe, ProjectLayer, Layer_Version, Machine, Project
24from django.db.models import Q, Max 24from django.db.models import Q, Max
25from django.conf.urls import url 25from django.conf.urls import url
@@ -202,28 +202,6 @@ class LayersTable(ToasterTable):
202 computation = lambda x: x.layer.name) 202 computation = lambda x: x.layer.name)
203 203
204 204
205
206
207class LayerDetails(ToasterTemplateView):
208 def get_context_data(self, **kwargs):
209 context = super(LayerDetails, self).get_context_data(**kwargs)
210 from toastergui.views import _lv_to_dict
211
212 context['project'] = Project.objects.get(pk=kwargs['pid'])
213 context['layerversion'] = Layer_Version.objects.get(pk=kwargs['layerid'])
214 context['layerdict'] = _lv_to_dict(context['project'], context['layerversion'])
215 context['layerdeps'] = {"list": [
216 [ {"id": y.id,
217 "name": y.layer.name,
218 "layerdetailurl": reverse('layerdetails', args=(kwargs['pid'], y.id)),
219 } for y in x.depends_on.get_equivalents_wpriority(context['project'])][0] for x in context['layerversion'].dependencies.all()]}
220 context['projectlayers'] = map(lambda prjlayer: prjlayer.layercommit.id, ProjectLayer.objects.filter(project=context['project']))
221
222 self.context_entries = ['project', 'layerversion', 'projectlayers', 'layerdict', 'layerdeps']
223
224 return context
225
226
227class MachinesTable(ToasterTable, ProjectFiltersMixin): 205class MachinesTable(ToasterTable, ProjectFiltersMixin):
228 """Table of Machines in Toaster""" 206 """Table of Machines in Toaster"""
229 207