diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/widgets.py')
-rw-r--r-- | bitbake/lib/toaster/toastergui/widgets.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/widgets.py b/bitbake/lib/toaster/toastergui/widgets.py index ceff52942e..b32abf40b3 100644 --- a/bitbake/lib/toaster/toastergui/widgets.py +++ b/bitbake/lib/toaster/toastergui/widgets.py | |||
@@ -7,6 +7,7 @@ | |||
7 | # | 7 | # |
8 | 8 | ||
9 | from django.views.generic import View, TemplateView | 9 | from django.views.generic import View, TemplateView |
10 | from django.utils.decorators import method_decorator | ||
10 | from django.views.decorators.cache import cache_control | 11 | from django.views.decorators.cache import cache_control |
11 | from django.shortcuts import HttpResponse | 12 | from django.shortcuts import HttpResponse |
12 | from django.core.cache import cache | 13 | from django.core.cache import cache |
@@ -31,6 +32,7 @@ import re | |||
31 | import os | 32 | import os |
32 | 33 | ||
33 | from toastergui.tablefilter import TableFilterMap | 34 | from toastergui.tablefilter import TableFilterMap |
35 | from toastermain.logs import log_view_mixin | ||
34 | 36 | ||
35 | try: | 37 | try: |
36 | from urllib import unquote_plus | 38 | from urllib import unquote_plus |
@@ -63,8 +65,8 @@ class ToasterTable(TemplateView): | |||
63 | self.default_orderby = "" | 65 | self.default_orderby = "" |
64 | 66 | ||
65 | # prevent HTTP caching of table data | 67 | # prevent HTTP caching of table data |
66 | @cache_control(must_revalidate=True, | 68 | @method_decorator(cache_control(must_revalidate=True, |
67 | max_age=0, no_store=True, no_cache=True) | 69 | max_age=0, no_store=True, no_cache=True)) |
68 | def dispatch(self, *args, **kwargs): | 70 | def dispatch(self, *args, **kwargs): |
69 | return super(ToasterTable, self).dispatch(*args, **kwargs) | 71 | return super(ToasterTable, self).dispatch(*args, **kwargs) |
70 | 72 | ||
@@ -83,6 +85,7 @@ class ToasterTable(TemplateView): | |||
83 | 85 | ||
84 | return context | 86 | return context |
85 | 87 | ||
88 | @log_view_mixin | ||
86 | def get(self, request, *args, **kwargs): | 89 | def get(self, request, *args, **kwargs): |
87 | if request.GET.get('format', None) == 'json': | 90 | if request.GET.get('format', None) == 'json': |
88 | 91 | ||
@@ -304,6 +307,7 @@ class ToasterTable(TemplateView): | |||
304 | 307 | ||
305 | self.setup_columns(**kwargs) | 308 | self.setup_columns(**kwargs) |
306 | 309 | ||
310 | self.apply_orderby('pk') | ||
307 | if search: | 311 | if search: |
308 | self.apply_search(search) | 312 | self.apply_search(search) |
309 | if filters: | 313 | if filters: |
@@ -413,6 +417,7 @@ class ToasterTypeAhead(View): | |||
413 | def __init__(self, *args, **kwargs): | 417 | def __init__(self, *args, **kwargs): |
414 | super(ToasterTypeAhead, self).__init__() | 418 | super(ToasterTypeAhead, self).__init__() |
415 | 419 | ||
420 | @log_view_mixin | ||
416 | def get(self, request, *args, **kwargs): | 421 | def get(self, request, *args, **kwargs): |
417 | def response(data): | 422 | def response(data): |
418 | return HttpResponse(json.dumps(data, | 423 | return HttpResponse(json.dumps(data, |
@@ -468,6 +473,7 @@ class MostRecentBuildsView(View): | |||
468 | 473 | ||
469 | return False | 474 | return False |
470 | 475 | ||
476 | @log_view_mixin | ||
471 | def get(self, request, *args, **kwargs): | 477 | def get(self, request, *args, **kwargs): |
472 | """ | 478 | """ |
473 | Returns a list of builds in JSON format. | 479 | Returns a list of builds in JSON format. |