summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@0d.be>2012-06-04 07:21:09 (GMT)
committerFrédéric Péters <fpeters@0d.be>2012-06-04 07:21:09 (GMT)
commitca0c69af5d6e08ba26857df18c2c19bb1940741d (patch)
tree5e32a5d207c61a85c2ca061d8d249301ffb610a2
parentac8d07355aeaca8856e13df0856a51e2fa80f555 (diff)
downloadtabellio.searchform-ca0c69af5d6e08ba26857df18c2c19bb1940741d.zip
tabellio.searchform-ca0c69af5d6e08ba26857df18c2c19bb1940741d.tar.gz
tabellio.searchform-ca0c69af5d6e08ba26857df18c2c19bb1940741d.tar.bz2
special case search on a single number (#1138)
-rw-r--r--tabellio/searchform/simple.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tabellio/searchform/simple.py b/tabellio/searchform/simple.py
index 44cc561..65e3ce1 100644
--- a/tabellio/searchform/simple.py
+++ b/tabellio/searchform/simple.py
@@ -120,11 +120,18 @@ class SimpleSearchView(BrowserView):
if not self.request.form.get('SearchableText'):
return []
sorton = self.request.form.get('docs-sort', 'session')
+ search_query = self.request.form.get('SearchableText')
+ try:
+ int(search_query)
+ except ValueError:
+ kwargs = {'SearchableText': search_query}
+ else:
+ kwargs = {'nodoc': search_query}
c = catalog(
portal_type=['tabellio.documents.dossier',
'tabellio.documents.document',
'tabellio.documents.question'],
- SearchableText=self.request.form.get('SearchableText'))
+ **kwargs)
if sorton == 'session':
cmpf = cmpfunctions.Cmp().cmp_session
elif sorton == 'type':