Created attachment 2341 [details] screenshot Tested on master: d9d5b8b499af3ae01a1e33d0d3969c54c2d4ab1b Steps to reproduce: 1. Start toaster and create 1 build 2. In the "All Builds" table, enable all columns from the "Edit Columns" menu. 3. Click on column head "Time" to sort by that column Expected result: Builds table gets sorted by Time column. Observed result: Application crashes with django error. See attached screenshot. Will attach traceback as well.
Traceback: Environment: Request Method: GET Request URL: http://127.0.0.1:8000/toastergui/builds/?count=10&orderby=timespent%3A-&page=1 Django Version: 1.5 Python Version: 2.7.6 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.messages', 'django.contrib.sessions', 'django.contrib.admin', 'django.contrib.staticfiles', 'django.contrib.humanize', 'orm', 'toastermain', 'south', 'bldcontrol', 'bldviewer', 'toastergui') 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/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response 115. response = callback(request, *callback_args, **callback_kwargs) File "/home/dave/poky/bitbake/lib/toaster/toastergui/views.py" in builds 1734. (filter_string, search_term, ordering_string) = _search_tuple(request, BuildRequest) File "/home/dave/poky/bitbake/lib/toaster/toastergui/views.py" in _search_tuple 205. raise BaseException("Invalid ordering model:" + str(model) + str(invalid)) Exception Type: BaseException at /toastergui/builds/ Exception Value: Invalid ordering model:<class 'bldcontrol.models.BuildRequest'>(u'timespent', ['brbitbake', 'brerror', 'brlayer', 'brtarget', 'brvariable', 'build', 'created', 'environment', u'id', 'project', 'state', 'updated'])
Pushed for review on poky-contrib:adamian/20150123-review
After some discussions about the utility of this sorting criteria and the amount of effort it would take to make it work, we have disabled the sorting by build time, so problem solved.
merged in master
Verified on master: 07f2eca7e9f9163ec48d3a417d8ba885a84762f3