From afe06e313eac61f598f65e622ceb5951a9fabc9a Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Tue, 19 May 2015 16:14:29 +0100 Subject: bitbake: toaster: move project data typeahead to the REST API This patch enables JSON requests on the project REST endpoint, and replaces the universal queries "xhr_datatypeahead" with the `project` type to the REST project endpoint. The patch adds a decorator that takes a context returned by a view and either renders the template specified as the decorator argument, or converts the context to JSON. Normal "search", "filter" and "order" options for view work as normal on the JSON API format. To enable the JSON return, set the "format" GET parameter to "json". In order to demonstrate the functionality, the "New build" button is switched from using the xhr_datatypeahead to the project REST API with JSON formatting. Additionally, the XHR APIs that perform actions with the project id passed as parameter are removed, and the needed URLs are populated from the project JSON API returns after the project has been selected. (Bitbake rev: 15a2274eba13d19b864f337057d61c75ff7849cc) Signed-off-by: Alexandru DAMIAN Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/urls.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'bitbake/lib/toaster/toastergui/urls.py') diff --git a/bitbake/lib/toaster/toastergui/urls.py b/bitbake/lib/toaster/toastergui/urls.py index 7a1132febc..4e328dae17 100644 --- a/bitbake/lib/toaster/toastergui/urls.py +++ b/bitbake/lib/toaster/toastergui/urls.py @@ -77,8 +77,6 @@ urlpatterns = patterns('toastergui.views', url(r'^projects/$', 'projects', name='all-projects'), - url(r'^project/$', lambda x: HttpResponseBadRequest(), name='base_project'), - url(r'^project/(?P\d+)/$', 'project', name='project'), url(r'^project/(?P\d+)/configuration$', 'projectconf', name='projectconf'), url(r'^project/(?P\d+)/builds/$', 'projectbuilds', name='projectbuilds'), @@ -110,7 +108,6 @@ urlpatterns = patterns('toastergui.views', name="all-layers"), - url(r'^xhr_build/$', 'xhr_build', name='xhr_build'), url(r'^xhr_projectbuild/(?P\d+)$', 'xhr_projectbuild', name='xhr_projectbuild'), url(r'^xhr_projectinfo/$', 'xhr_projectinfo', name='xhr_projectinfo'), url(r'^xhr_projectedit/(?P\d+)$', 'xhr_projectedit', name='xhr_projectedit'), -- cgit v1.2.3-54-g00ecf