mirror of
https://git.yoctoproject.org/poky
synced 2026-06-03 01:40:07 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
da4c66385d
commit
af72d0fbb2
@@ -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"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user