From 6b6fba059eaeacfa8de0187d84a55bc709685e84 Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 22 Apr 2012 16:23:27 +0530 Subject: [PATCH] allow good search --- manifests/ships/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manifests/ships/views.py b/manifests/ships/views.py index edcf789..5f543a2 100644 --- a/manifests/ships/views.py +++ b/manifests/ships/views.py @@ -177,6 +177,7 @@ def shipList(request): flag = request.GET.get('flag', None) owner = request.GET.get('owner', None) port = request.GET.get('port', None) + goods = request.GET.get('goods', None) # country = request.GET.get('country', None) qset = Ship.objects.all() #add dates stuff @@ -192,6 +193,8 @@ def shipList(request): qset = qset.filter(owner_trans__icontains=owner) if port: qset = qset.filter(port__icontains=port) + if goods: + qset = qset.filter(good__description_string_trans__icontains=goods) # if country: # qset = qset.filter(country__icontains=country) paginator = Paginator(qset, page_size)