Patchwork [bitbake-devel,02/14] toaster: Update API

login
register
mail settings
Submitter Alexandru DAMIAN
Date April 4, 2014, 2:10 p.m.
Message ID <29ff11635f0ed27dcd7ea33521825e80a2e1ff67.1396620556.git.alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/70125/
State New
Headers show

Comments

Alexandru DAMIAN - April 4, 2014, 2:10 p.m.
From: Belen Barros Pena <belen.barros.pena@intel.com>

Make sure the REST API includes the latest changes
to the database schema.

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
---
 lib/toaster/bldviewer/api.py   | 3 ++-
 lib/toaster/bldviewer/views.py | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/lib/toaster/bldviewer/api.py b/lib/toaster/bldviewer/api.py
index 76d45c7..c4c6135 100644
--- a/lib/toaster/bldviewer/api.py
+++ b/lib/toaster/bldviewer/api.py
@@ -25,12 +25,13 @@  from django.conf.urls import patterns, include, url
 urlpatterns = patterns('bldviewer.views',
         url(r'^builds$', 'model_explorer',  {'model_name':'build'}, name='builds'),
         url(r'^targets$', 'model_explorer',  {'model_name':'target'}, name='targets'),
+        url(r'^target_files$', 'model_explorer',  {'model_name':'target_file'}, name='target_file'),
         url(r'^target_image_file$', 'model_explorer',  {'model_name':'target_image_file'}, name='target_image_file'),
         url(r'^tasks$', 'model_explorer', {'model_name':'task'}, name='task'),
         url(r'^task_dependencies$', 'model_explorer',  {'model_name':'task_dependency'}, name='task_dependencies'),
         url(r'^packages$', 'model_explorer',  {'model_name':'package'}, name='package'),
         url(r'^package_dependencies$', 'model_explorer',  {'model_name':'package_dependency'}, name='package_dependency'),
-        url(r'^target_packages$', 'model_explorer',  {'model_name':'target_package'}, name='target_packages'),
+        url(r'^target_packages$', 'model_explorer',  {'model_name':'target_installed_package'}, name='target_packages'),
         url(r'^target_installed_packages$', 'model_explorer',  {'model_name':'target_installed_package'}, name='target_installed_package'),
         url(r'^package_files$', 'model_explorer',  {'model_name':'build_file'}, name='build_file'),
         url(r'^layers$', 'model_explorer', {'model_name':'layer'}, name='layer'),
diff --git a/lib/toaster/bldviewer/views.py b/lib/toaster/bldviewer/views.py
index 6f86379..c2e0c0c 100644
--- a/lib/toaster/bldviewer/views.py
+++ b/lib/toaster/bldviewer/views.py
@@ -25,7 +25,7 @@  from django.db.models import Q
 from django.shortcuts import render
 from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable, Target_Installed_Package
 from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency
-from orm.models import Target_Installed_Package, VariableHistory, Target_Image_File
+from orm.models import Target_Installed_Package, VariableHistory, Target_Image_File, Target_File
 from django.views.decorators.cache import cache_control
 from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
 
@@ -159,6 +159,7 @@  def model_explorer(request, model_name):
     model_mapping = {
         'build': Build,
         'target': Target,
+        'target_file': Target_File,
         'target_image_file': Target_Image_File,
         'task': Task,
         'task_dependency': Task_Dependency,