Tested on 1.9 M1 RC2: f9ea480e6c26fea46c3011c4e9d0e2de3d5c81b4 In the "All Builds" table sorting by "Errors", "Warnings" or "Time" causes Toaster to throw an exception: BaseException at /toastergui/builds/ Invalid ordering model:<class 'orm.models.Build'>(u'timespent', ['bitbake_version', 'build_name', 'buildartifact', 'buildrequest', 'completed_on', 'cooker_log_path', 'distro', 'distro_version', 'helptext_build', u'id', 'layer_version_build', 'logmessage', 'machine', 'outcome', 'package', 'project', 'started_on', 'target', 'task_build', 'variable_build']) Request Method: GET Request URL: http://localhost:8000/toastergui/builds/?orderby=timespent%3A-&count=10&search=&page=1 Django Version: 1.6.6 Exception Type: BaseException Exception Value: Invalid ordering model:<class 'orm.models.Build'>(u'timespent', ['bitbake_version', 'build_name', 'buildartifact', 'buildrequest', 'completed_on', 'cooker_log_path', 'distro', 'distro_version', 'helptext_build', u'id', 'layer_version_build', 'logmessage', 'machine', 'outcome', 'package', 'project', 'started_on', 'target', 'task_build', 'variable_build']) Exception Location: /home/gushie/poky/bitbake/lib/toaster/toastergui/views.py in _search_tuple, line 329 Python Executable: /usr/bin/python Python Version: 2.7.8 Python Path: ['bitbake/bin/../lib', '/home/gushie/poky/bitbake/lib', '/home/gushie/poky/bitbake/lib/toaster', '/usr/lib64/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7/site-packages', '/usr/lib64/python2.7/site-packages/gtk-2.0', '/usr/lib/python2.7/site-packages', '/home/gushie/poky/bitbake/lib/toaster/contrib/django-aggregate-if-master'] Traceback in next comment.
Traceback: Environment: Request Method: GET Request URL: http://localhost:8000/toastergui/builds/?count=10&orderby=timespent%3A-&page=1 Django Version: 1.6.6 Python Version: 2.7.8 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.messages', 'django.contrib.sessions', 'django.contrib.admin', 'django.contrib.staticfiles', 'django.contrib.humanize', 'bldcollector', 'toastermain', 'south', 'toastergui', 'bldcontrol', 'orm') Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware') Traceback: File "/usr/lib64/python2.7/site-packages/django/core/handlers/base.py" in get_response 112. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/gushie/poky/bitbake/lib/toaster/toastergui/views.py" in returned_wrapper 138. context = view(request, *args, **kwargs) File "/home/gushie/poky/bitbake/lib/toaster/toastergui/views.py" in builds 1886. context, pagesize, orderby = _build_list_helper(request, queryset) File "/home/gushie/poky/bitbake/lib/toaster/toastergui/views.py" in _build_list_helper 1906. (filter_string, search_term, ordering_string) = _search_tuple(request, Build) File "/home/gushie/poky/bitbake/lib/toaster/toastergui/views.py" in _search_tuple 329. raise BaseException("Invalid ordering model:" + str(model) + str(invalid)) Exception Type: BaseException at /toastergui/builds/ Exception Value: Invalid ordering model:<class 'orm.models.Build'>(u'timespent', ['bitbake_version', 'build_name', 'buildartifact', 'buildrequest', 'completed_on', 'cooker_log_path', 'distro', 'distro_version', 'helptext_build', u'id', 'layer_version_build', 'logmessage', 'machine', 'outcome', 'package', 'project', 'started_on', 'target', 'task_build', 'variable_build'])
This breaks because "timespent" is not a field in the database, but it is calculated on the fly. There are two ways to go about here: a). disable sorting by time spent b). add the field to the database Belen, we need your input.
(In reply to comment #2) > This breaks because "timespent" is not a field in the database, but it is > calculated on the fly. It looks like this would explain why sorting by 'time' throws an error, but I am not sure it explains why sorting by 'errors' and 'warnings' also throws an error. Although the error seems to be the same error in all cases, so I could be wrong. > > There are two ways to go about here: > > a). disable sorting by time spent > > b). add the field to the database I am ok with disabling the sorting by 'time', unless we think that adding the field to the database could improve performance in any way. > > > Belen, we need your input.
*** Bug 8131 has been marked as a duplicate of this bug. ***
*** Bug 8228 has been marked as a duplicate of this bug. ***
Triggers the same problem caused by bug #8131 *** This bug has been marked as a duplicate of bug 8131 ***
As per last comment set it as verified duplicate.