Patchwork [bitbake-devel,43/94] bitbake: webhob: add more models to webhob API

login
register
mail settings
Submitter Alexandru DAMIAN
Date Sept. 24, 2013, 4:52 p.m.
Message ID <3656778790aa9961cc42132aabd885ddb5333506.1380041477.git.alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/58799/
State New
Headers show

Comments

Alexandru DAMIAN - Sept. 24, 2013, 4:52 p.m.
From: Calin Dragomir <calinx.l.dragomir@intel.com>

This patch enables webhob API to support recipe, layer and
layer_version models.

Signed-off-by: Calin Dragomir <calinx.l.dragomir@intel.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 bitbake/lib/webhob/bldviewer/api.py   | 3 +++
 bitbake/lib/webhob/bldviewer/views.py | 7 +++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

Patch

diff --git a/bitbake/lib/webhob/bldviewer/api.py b/bitbake/lib/webhob/bldviewer/api.py
index 3b2d7d2..9fa701c 100644
--- a/bitbake/lib/webhob/bldviewer/api.py
+++ b/bitbake/lib/webhob/bldviewer/api.py
@@ -5,4 +5,7 @@  urlpatterns = patterns('bldviewer.views',
         url(r'^builds/$', 'model_explorer',  {'model_name':'build'}, name='builds'),
         url(r'^tasks/$', 'model_explorer', {'model_name':'task'}, name='task'),
         url(r'^packages/$', 'model_explorer', {'model_name':'package'}, name='package'),
+        url(r'^layers/$', 'model_explorer', {'model_name':'layer'}, name='layer'),
+        url(r'^recipes/$', 'model_explorer', {'model_name':'recipe'}, name='recipe'),
+        url(r'^layersversions/$', 'model_explorer', {'model_name':'layerversion'}, name='layerversion'),
 )
diff --git a/bitbake/lib/webhob/bldviewer/views.py b/bitbake/lib/webhob/bldviewer/views.py
index 647a1f2..3ef6940 100644
--- a/bitbake/lib/webhob/bldviewer/views.py
+++ b/bitbake/lib/webhob/bldviewer/views.py
@@ -43,9 +43,9 @@  def layer(request):
 def layer_versions_recipes(request, layerversion_id):
     template = 'recipe.html'
     recipes = Recipe.objects.filter(layer_version__id = layerversion_id)
-    
+
     context = {'recipes': recipes}
-    
+
     return render(request, template, context)
 
 #### API
@@ -63,6 +63,9 @@  def model_explorer(request, model_name):
         'build': Build,
         'task': Task,
         'package': Package,
+        'layer': Layer,
+        'layerversion': Layer_Version,
+        'recipe': Recipe,
         }
 
     if model_name not in model_mapping.keys():