]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: typeaheads Layers add url to layer REST API to the layer
authorMichael Wood <michael.g.wood@intel.com>
Fri, 9 Dec 2016 16:52:52 +0000 (16:52 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 12 Dec 2016 20:44:47 +0000 (20:44 +0000)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/toaster/toastergui/typeaheads.py

index 53160002093b3507551a6efbd33e9b66d84b3b4e..58c650f8fcc8770933da42db8e97e7b50401b4b8 100644 (file)
@@ -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,