From 8bab4817bb8580a010eee79a260e3557a30a67df Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 22 Apr 2012 20:17:05 +0530 Subject: [PATCH] page bug again --- manifests/ships/views.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/manifests/ships/views.py b/manifests/ships/views.py index 7e2828c..9d5f629 100644 --- a/manifests/ships/views.py +++ b/manifests/ships/views.py @@ -168,8 +168,8 @@ def stringtranslate(request): @login_required def shipList(request): - page = int(request.GET.get('page', 1)) - page_size = int(request.GET.get('page_size', 50)) + page = request.GET.get('page', '') + page_size = request.GET.get('page_size', '') startDate = request.GET.get('start_date', '') endDate = request.GET.get('end_date', '') billType = request.GET.get('bill_type', '') @@ -182,6 +182,10 @@ def shipList(request): sort = request.GET.get('sort', 'date') # country = request.GET.get('country', None) qset = Ship.objects.all() + if page == '': + page = 1 + if page_size == '': + page_size = 50 if startDate != '': start_dt = datetime.strptime(startDate, '%Y-%m-%d') qset = qset.filter(date__gte=start_dt)