diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
| -rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 295773fc66..fbae36c69c 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
| @@ -91,6 +91,7 @@ def landing(request): | |||
| 91 | 91 | ||
| 92 | return render(request, 'landing.html', context) | 92 | return render(request, 'landing.html', context) |
| 93 | 93 | ||
| 94 | """ | ||
| 94 | # returns a list for most recent builds; | 95 | # returns a list for most recent builds; |
| 95 | def _get_latest_builds(prj=None): | 96 | def _get_latest_builds(prj=None): |
| 96 | queryset = Build.objects.all() | 97 | queryset = Build.objects.all() |
| @@ -101,8 +102,9 @@ def _get_latest_builds(prj=None): | |||
| 101 | return list(itertools.chain( | 102 | return list(itertools.chain( |
| 102 | queryset.filter(outcome=Build.IN_PROGRESS).order_by("-started_on"), | 103 | queryset.filter(outcome=Build.IN_PROGRESS).order_by("-started_on"), |
| 103 | queryset.filter(outcome__lt=Build.IN_PROGRESS).order_by("-started_on")[:3] )) | 104 | queryset.filter(outcome__lt=Build.IN_PROGRESS).order_by("-started_on")[:3] )) |
| 105 | """ | ||
| 104 | 106 | ||
| 105 | 107 | """ | |
| 106 | # a JSON-able dict of recent builds; for use in the Project page, xhr_ updates, and other places, as needed | 108 | # a JSON-able dict of recent builds; for use in the Project page, xhr_ updates, and other places, as needed |
| 107 | def _project_recent_build_list(prj): | 109 | def _project_recent_build_list(prj): |
| 108 | data = [] | 110 | data = [] |
| @@ -131,8 +133,7 @@ def _project_recent_build_list(prj): | |||
| 131 | data.append(d) | 133 | data.append(d) |
| 132 | 134 | ||
| 133 | return data | 135 | return data |
| 134 | 136 | """ | |
| 135 | |||
| 136 | 137 | ||
| 137 | def objtojson(obj): | 138 | def objtojson(obj): |
| 138 | from django.db.models.query import QuerySet | 139 | from django.db.models.query import QuerySet |
| @@ -1915,6 +1916,7 @@ if True: | |||
| 1915 | ''' The exception raised on invalid POST requests ''' | 1916 | ''' The exception raised on invalid POST requests ''' |
| 1916 | pass | 1917 | pass |
| 1917 | 1918 | ||
| 1919 | """ | ||
| 1918 | # helper function, to be used on "all builds" and "project builds" pages | 1920 | # helper function, to be used on "all builds" and "project builds" pages |
| 1919 | def _build_list_helper(request, queryset_all, redirect_page, pid=None): | 1921 | def _build_list_helper(request, queryset_all, redirect_page, pid=None): |
| 1920 | default_orderby = 'completed_on:-' | 1922 | default_orderby = 'completed_on:-' |
| @@ -2119,6 +2121,7 @@ if True: | |||
| 2119 | # merge daterange values | 2121 | # merge daterange values |
| 2120 | context.update(context_date) | 2122 | context.update(context_date) |
| 2121 | return context, pagesize, orderby | 2123 | return context, pagesize, orderby |
| 2124 | """ | ||
| 2122 | 2125 | ||
| 2123 | 2126 | ||
| 2124 | 2127 | ||
| @@ -2256,7 +2259,7 @@ if True: | |||
| 2256 | "completedbuilds": Build.objects.exclude(outcome = Build.IN_PROGRESS).filter(project_id = pid), | 2259 | "completedbuilds": Build.objects.exclude(outcome = Build.IN_PROGRESS).filter(project_id = pid), |
| 2257 | "prj" : {"name": prj.name, }, | 2260 | "prj" : {"name": prj.name, }, |
| 2258 | "buildrequests" : prj.build_set.filter(outcome=Build.IN_PROGRESS), | 2261 | "buildrequests" : prj.build_set.filter(outcome=Build.IN_PROGRESS), |
| 2259 | "builds" : _project_recent_build_list(prj), | 2262 | #"builds" : _project_recent_build_list(prj), |
| 2260 | "layers" : map(lambda x: { | 2263 | "layers" : map(lambda x: { |
| 2261 | "id": x.layercommit.pk, | 2264 | "id": x.layercommit.pk, |
| 2262 | "orderid": x.pk, | 2265 | "orderid": x.pk, |
| @@ -2827,10 +2830,8 @@ if True: | |||
| 2827 | # will set the GET parameters and redirect back to the | 2830 | # will set the GET parameters and redirect back to the |
| 2828 | # all-builds or projectbuilds page as appropriate; | 2831 | # all-builds or projectbuilds page as appropriate; |
| 2829 | # TODO don't use exceptions to control program flow | 2832 | # TODO don't use exceptions to control program flow |
| 2830 | @_template_renderer('projectbuilds.html') | 2833 | """ |
| 2831 | def projectbuilds(request, pid): | 2834 | def projectbuilds(request, pid): |
| 2832 | prj = Project.objects.get(id = pid) | ||
| 2833 | |||
| 2834 | if request.method == "POST": | 2835 | if request.method == "POST": |
| 2835 | # process any build request | 2836 | # process any build request |
| 2836 | 2837 | ||
| @@ -2880,6 +2881,7 @@ if True: | |||
| 2880 | context['mru'] = _get_latest_builds(prj) | 2881 | context['mru'] = _get_latest_builds(prj) |
| 2881 | 2882 | ||
| 2882 | return context | 2883 | return context |
| 2884 | """ | ||
| 2883 | 2885 | ||
| 2884 | 2886 | ||
| 2885 | def _file_name_for_artifact(b, artifact_type, artifact_id): | 2887 | def _file_name_for_artifact(b, artifact_type, artifact_id): |
