From 7868deb46e98c18bbc7d3d3402d2becee4950fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 4 Jun 2012 09:31:23 +0200 Subject: [PATCH] limit single number search to documents --- tabellio/searchform/simple.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tabellio/searchform/simple.py b/tabellio/searchform/simple.py index 65e3ce1..540a618 100644 --- a/tabellio/searchform/simple.py +++ b/tabellio/searchform/simple.py @@ -124,14 +124,15 @@ class SimpleSearchView(BrowserView): try: int(search_query) except ValueError: - kwargs = {'SearchableText': search_query} - else: - kwargs = {'nodoc': search_query} - c = catalog( + c = catalog( portal_type=['tabellio.documents.dossier', 'tabellio.documents.document', 'tabellio.documents.question'], - **kwargs) + SearchableText=search_query) + else: + c = catalog( + portal_type=['tabellio.documents.document'], + nodos=search_query) if sorton == 'session': cmpf = cmpfunctions.Cmp().cmp_session elif sorton == 'type':