From af72d0fbb2d0f4d9aa29e124b3b4e216017f771d Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Thu, 6 Aug 2015 19:01:35 +0300 Subject: 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 Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/tables.py | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'bitbake/lib/toaster/toastergui/tables.py') 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 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from toastergui.widgets import ToasterTable, ToasterTemplateView +from toastergui.widgets import ToasterTable from orm.models import Recipe, ProjectLayer, Layer_Version, Machine, Project from django.db.models import Q, Max from django.conf.urls import url @@ -202,28 +202,6 @@ class LayersTable(ToasterTable): computation = lambda x: x.layer.name) - - -class LayerDetails(ToasterTemplateView): - def get_context_data(self, **kwargs): - context = super(LayerDetails, self).get_context_data(**kwargs) - from toastergui.views import _lv_to_dict - - context['project'] = Project.objects.get(pk=kwargs['pid']) - context['layerversion'] = Layer_Version.objects.get(pk=kwargs['layerid']) - context['layerdict'] = _lv_to_dict(context['project'], context['layerversion']) - context['layerdeps'] = {"list": [ - [ {"id": y.id, - "name": y.layer.name, - "layerdetailurl": reverse('layerdetails', args=(kwargs['pid'], y.id)), - } for y in x.depends_on.get_equivalents_wpriority(context['project'])][0] for x in context['layerversion'].dependencies.all()]} - context['projectlayers'] = map(lambda prjlayer: prjlayer.layercommit.id, ProjectLayer.objects.filter(project=context['project'])) - - self.context_entries = ['project', 'layerversion', 'projectlayers', 'layerdict', 'layerdeps'] - - return context - - class MachinesTable(ToasterTable, ProjectFiltersMixin): """Table of Machines in Toaster""" -- cgit v1.2.3-54-g00ecf