diff --git a/pandora/archive/views.py b/pandora/archive/views.py index ed89439..cc0672a 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -447,7 +447,8 @@ Positions response['data']['items'] = qs.count() elif 'positions' in query: #FIXME: this does not scale for larger results - qs = _order_query(query['qs'], query['sort']) + qs = models.File.objects.filter(item__in=query['qs']) + qs = _order_query(qs, query['sort']) response['data']['positions'] = {} ids = [j['itemId'] for j in qs.values('itemId')]