aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-06-05 17:57:24 +0100
committerMichael Wood <michael.g.wood@intel.com>2015-06-05 17:57:24 +0100
commit69ee069a6a49d4ed9a37d22fdb7600d7f1555be2 (patch)
tree75860058f3c0cc679c1d4c08ee3d2090e7695193
parentfc98af4d6bfa8567e963ba04e516fbd42e71b0e2 (diff)
downloaderror-report-web-69ee069a6a49d4ed9a37d22fdb7600d7f1555be2.tar.gz
error-report-web-69ee069a6a49d4ed9a37d22fdb7600d7f1555be2.tar.bz2
error-report-web-69ee069a6a49d4ed9a37d22fdb7600d7f1555be2.zip
views: Remove redundant paginator mechanism0.3
We use the proper paginator from django now and always have an order_by set so this mechanism redundant. Signed-off-by: Michael Wood <michael.g.wood@intel.com>
-rw-r--r--Post/views.py13
1 files changed, 0 insertions, 13 deletions
diff --git a/Post/views.py b/Post/views.py
index 6322640..0455baa 100644
--- a/Post/views.py
+++ b/Post/views.py
@@ -220,19 +220,6 @@ def search(request, mode=results_mode.LATEST, **kwargs):
# "no results found"
items = items.none()
- # Do some special filtering to reduce the QuerySet to a manageable size
- # reversing or ordering the whole queryset is very expensive so we use
- # a range instead and then feed that to the paginator.
- elif mode == results_mode.LATEST and not request.GET.has_key('filter'):
- total = items.count()
- # Get an extra two pages worth to populate the paginator
- try:
- total_from = total - limit*(int(page)+2)
- except:
- total_from = total - limit
-
- items = items.filter(id__range=(total_from,total))
-
# Make sure we get django to do an inner join on our foreign key rather
# than a query for each item
items = items.select_related("BUILD").order_by(order_by)