summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-01-15 13:00:49 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-15 16:29:59 +0000
commit294579b531d5a96a17aa863554e71f4680d35812 (patch)
treed42f10f98cb26d233860eec59cbdf0799d53ae28 /bitbake/lib/toaster/toastergui/views.py
parent6c12ca7f932d2fa06c2f2e2e6c98c76bb4d487d3 (diff)
downloadpoky-294579b531d5a96a17aa863554e71f4680d35812.tar.gz
bitbake: toastergui: convert all builds page to ToasterTable
For better long-term maintainability, use ToasterTable instead of Django template and view code to display the all builds page. NB the builds.html template has been left in, as this will otherwise cause conflicts when merging the new theme. [YOCTO #8738] (Bitbake rev: e0590fc8103afeb4c5e613a826057555c8193d59) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index a79261de96..295773fc66 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -1915,34 +1915,6 @@ if True:
1915 ''' The exception raised on invalid POST requests ''' 1915 ''' The exception raised on invalid POST requests '''
1916 pass 1916 pass
1917 1917
1918 # shows the "all builds" page for managed mode; it displays build requests (at least started!) instead of actual builds
1919 # WARNING _build_list_helper() may raise a RedirectException, which
1920 # will set the GET parameters and redirect back to the
1921 # all-builds or projectbuilds page as appropriate;
1922 # TODO don't use exceptions to control program flow
1923 @_template_renderer("builds.html")
1924 def builds(request):
1925 # define here what parameters the view needs in the GET portion in order to
1926 # be able to display something. 'count' and 'page' are mandatory for all views
1927 # that use paginators.
1928
1929 queryset = Build.objects.all()
1930
1931 redirect_page = resolve(request.path_info).url_name
1932
1933 context, pagesize, orderby = _build_list_helper(request,
1934 queryset,
1935 redirect_page)
1936 # all builds page as a Project column
1937 context['tablecols'].append({
1938 'name': 'Project',
1939 'clclass': 'project_column'
1940 })
1941
1942 _set_parameters_values(pagesize, orderby, request)
1943 return context
1944
1945
1946 # helper function, to be used on "all builds" and "project builds" pages 1918 # helper function, to be used on "all builds" and "project builds" pages
1947 def _build_list_helper(request, queryset_all, redirect_page, pid=None): 1919 def _build_list_helper(request, queryset_all, redirect_page, pid=None):
1948 default_orderby = 'completed_on:-' 1920 default_orderby = 'completed_on:-'
@@ -1986,10 +1958,6 @@ if True:
1986 warnings_no = Count('logmessage', only=q_warnings) 1958 warnings_no = Count('logmessage', only=q_warnings)
1987 ) 1959 )
1988 1960
1989 # add timespent field
1990 timespent = 'completed_on - started_on'
1991 queryset_all = queryset_all.extra(select={'timespent': timespent})
1992
1993 queryset_with_search = _get_queryset(Build, queryset_all, 1961 queryset_with_search = _get_queryset(Build, queryset_all,
1994 None, search_term, 1962 None, search_term,
1995 ordering_string, '-completed_on') 1963 ordering_string, '-completed_on')