[bitbake-devel] [PATCH 45/94] bitbake: webhob: fix ordering issue
Alex DAMIAN
alexandru.damian at intel.com
Tue Sep 24 16:52:14 UTC 2013
From: Calin Dragomir <calinx.l.dragomir at intel.com>
This patch fixes the AssertionError issue that caused the
build page to break.
This happened because ordering cannot be done after a slicing
operation has been executed.
By placing the ordering before the slicing occurs, the issue
stops appearing.
Signed-off-by: Calin Dragomir <calinx.l.dragomir at intel.com>
Conflicts:
bitbake/lib/webhob/bldviewer/views.py
---
bitbake/lib/webhob/bldviewer/views.py | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/bitbake/lib/webhob/bldviewer/views.py b/bitbake/lib/webhob/bldviewer/views.py
index 423fdf7..a5c4387 100644
--- a/bitbake/lib/webhob/bldviewer/views.py
+++ b/bitbake/lib/webhob/bldviewer/views.py
@@ -110,6 +110,13 @@ def model_explorer(request, model_name):
if search_term:
queryset = _get_search_results(search_term, queryset, model)
+ if ordering_string and queryset:
+ column, order = ordering_string.split(':')
+ if order.lower() == DESCENDING:
+ queryset = queryset.order_by('-' + column)
+ else:
+ queryset = queryset.order_by(column)
+
if offset and limit:
queryset = queryset[offset:(offset+limit)]
elif offset:
@@ -122,13 +129,6 @@ def model_explorer(request, model_name):
else:
response_data['count'] = 0
- if queryset and ordering_string:
- column, order = ordering_string.split(':')
- if order.lower() == DESCENDING:
- queryset = queryset.order_by('-' + column)
- else:
- queryset = queryset.order_by(column)
-
response_data['list'] = serializers.serialize('json', queryset)
return HttpResponse(json.dumps(response_data),
--
1.8.1.2
More information about the bitbake-devel
mailing list