summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@0d.be>2011-12-01 12:06:46 (GMT)
committerFrédéric Péters <fpeters@0d.be>2011-12-01 12:06:46 (GMT)
commit9e5404f3079ec2da1548b38fe2aa650816c3af40 (patch)
tree02f5a2f50e766f50f4d7089bfdbbfbd4afe0f225
parent38f3e49e7a7b4c0d8c6a7b242ca4e993a72ee233 (diff)
downloadtabellio.searchform-9e5404f3079ec2da1548b38fe2aa650816c3af40.zip
tabellio.searchform-9e5404f3079ec2da1548b38fe2aa650816c3af40.tar.gz
tabellio.searchform-9e5404f3079ec2da1548b38fe2aa650816c3af40.tar.bz2
fix text search in non db case
-rw-r--r--tabellio/searchform/form.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tabellio/searchform/form.py b/tabellio/searchform/form.py
index 8179c65..fb199b1 100644
--- a/tabellio/searchform/form.py
+++ b/tabellio/searchform/form.py
@@ -773,8 +773,12 @@ class SearchView(BrowserView):
return []
if data.get('text'):
- # plaintext search, get document ids from postgresql
- kw['id'] = self.get_ids_from_postgres(data.get('text'))
+ portal = getToolByName(self.context, 'portal_url').getPortalObject()
+ if hasattr(portal, 'db'):
+ # plaintext search, get document ids from postgresql
+ kw['id'] = self.get_ids_from_postgres(data.get('text'))
+ else:
+ kw['SearchableText'] = data.get('text')
if data.get('search_type_is_document'):
kw['portal_type'] = 'tabellio.documents.document'