diff options
author | David Reyna <David.Reyna@windriver.com> | 2014-04-10 21:43:11 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-05-08 16:18:12 +0100 |
commit | 961f6226fa8019a7492ee40fdba18c5916065001 (patch) | |
tree | c4808d1af2f3fbe49868bdcbcc822df0f78f6af6 /bitbake/lib/toaster | |
parent | 138ed549920a27e28858e4a506fd423e913a014e (diff) | |
download | poky-961f6226fa8019a7492ee40fdba18c5916065001.tar.gz |
bitbake: toaster: sort outcome and sstate columns by string value
Sort the 'outcome' and 'sstate_result' columns by their
description string values and not their numerical values.
[YOCTO #5921]
(Bitbake rev: eee0abe70e4d85a0753f0b122518d7a9f06181bc)
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster')
-rw-r--r-- | bitbake/lib/toaster/orm/models.py | 12 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/views.py | 9 |
2 files changed, 20 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index c344c66bee..22c66a9a28 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
@@ -166,9 +166,18 @@ class Task(models.Model): | |||
166 | def get_related_setscene(self): | 166 | def get_related_setscene(self): |
167 | return Task.objects.related_setscene(self) | 167 | return Task.objects.related_setscene(self) |
168 | 168 | ||
169 | def get_outcome_text(self): | ||
170 | return Task.TASK_OUTCOME[self.outcome + 1][1] | ||
171 | |||
169 | def get_outcome_help(self): | 172 | def get_outcome_help(self): |
170 | return Task.TASK_OUTCOME_HELP[self.outcome][1] | 173 | return Task.TASK_OUTCOME_HELP[self.outcome][1] |
171 | 174 | ||
175 | def get_sstate_text(self): | ||
176 | if self.sstate_result==Task.SSTATE_NA: | ||
177 | return '' | ||
178 | else: | ||
179 | return Task.SSTATE_RESULT[self.sstate_result][1] | ||
180 | |||
172 | def get_executed_display(self): | 181 | def get_executed_display(self): |
173 | if self.task_executed: | 182 | if self.task_executed: |
174 | return "Executed" | 183 | return "Executed" |
@@ -200,6 +209,9 @@ class Task(models.Model): | |||
200 | message = models.CharField(max_length=240) | 209 | message = models.CharField(max_length=240) |
201 | logfile = models.FilePathField(max_length=255, blank=True) | 210 | logfile = models.FilePathField(max_length=255, blank=True) |
202 | 211 | ||
212 | outcome_text = property(get_outcome_text) | ||
213 | sstate_text = property(get_sstate_text) | ||
214 | |||
203 | class Meta: | 215 | class Meta: |
204 | ordering = ('order', 'recipe' ,) | 216 | ordering = ('order', 'recipe' ,) |
205 | unique_together = ('build', 'recipe', 'task_name', ) | 217 | unique_together = ('build', 'recipe', 'task_name', ) |
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 53be9671d1..3d2ed4c7c1 100644 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -853,7 +853,14 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
853 | (filter_string, search_term, ordering_string) = _search_tuple(request, Task) | 853 | (filter_string, search_term, ordering_string) = _search_tuple(request, Task) |
854 | queryset_all = Task.objects.filter(build=build_id).exclude(order__isnull=True).exclude(outcome=Task.OUTCOME_NA) | 854 | queryset_all = Task.objects.filter(build=build_id).exclude(order__isnull=True).exclude(outcome=Task.OUTCOME_NA) |
855 | queryset_with_search = _get_queryset(Task, queryset_all, None , search_term, ordering_string, 'order') | 855 | queryset_with_search = _get_queryset(Task, queryset_all, None , search_term, ordering_string, 'order') |
856 | queryset = _get_queryset(Task, queryset_all, filter_string, search_term, ordering_string, 'order') | 856 | if ordering_string.startswith('outcome'): |
857 | queryset = _get_queryset(Task, queryset_all, filter_string, search_term, 'order:+', 'order') | ||
858 | queryset = sorted(queryset, key=lambda ur: (ur.outcome_text), reverse=ordering_string.endswith('-')) | ||
859 | elif ordering_string.startswith('sstate_result'): | ||
860 | queryset = _get_queryset(Task, queryset_all, filter_string, search_term, 'order:+', 'order') | ||
861 | queryset = sorted(queryset, key=lambda ur: (ur.sstate_text), reverse=ordering_string.endswith('-')) | ||
862 | else: | ||
863 | queryset = _get_queryset(Task, queryset_all, filter_string, search_term, ordering_string, 'order') | ||
857 | 864 | ||
858 | # compute the anchor's page | 865 | # compute the anchor's page |
859 | if anchor: | 866 | if anchor: |