[2/5] toaster: typeaheads Layers add url to layer REST API to the layer

Submitted by Michael Wood on Dec. 8, 2016, 6:42 p.m. | Patch ID: 134892

Details

Message ID 1481222571-17651-3-git-send-email-michael.g.wood@intel.com
State New
Headers show

Commit Message

Michael Wood Dec. 8, 2016, 6:42 p.m.
Add the url to the Layer typeahead so that this can be used later on by
the front end code to look up layer details.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
---
 bitbake/lib/toaster/toastergui/typeaheads.py | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/bitbake/lib/toaster/toastergui/typeaheads.py b/bitbake/lib/toaster/toastergui/typeaheads.py
index 5316000..58c650f 100644
--- a/bitbake/lib/toaster/toastergui/typeaheads.py
+++ b/bitbake/lib/toaster/toastergui/typeaheads.py
@@ -23,6 +23,7 @@  from orm.models import Project
 from django.core.urlresolvers import reverse
 from django.core.cache import cache
 
+
 class LayersTypeAhead(ToasterTypeAhead):
     """ Typeahead for layers available and not added in the current project's
     configuration """
@@ -55,6 +56,8 @@  class LayersTypeAhead(ToasterTypeAhead):
                 'id': layer_version.pk,
                 'name': layer_version.layer.name,
                 'layerdetailurl': layer_version.get_detailspage_url(prj.pk),
+                'xhrLayerUrl': reverse('xhr_layer',
+                                       args=(prj.pk, layer_version.pk)),
                 'vcs_url': layer_version.layer.vcs_url,
                 'vcs_reference': vcs_reference,
                 'detail': detail,