Bugfix in the search engine, implemented float fields in the advanced search, execute batchjobs as Zope admin.

This commit is contained in:
Gaetan Delannay 2010-01-14 17:54:18 +01:00
parent d192496c88
commit bdc7baf25a
5 changed files with 61 additions and 36 deletions

View file

@ -283,7 +283,7 @@ class AbstractWrapper:
maxResults=maxResults, noSecurity=noSecurity)
return [o.appy() for o in res['objects']]
def count(self, klass, **fields):
def count(self, klass, noSecurity=False, **fields):
'''Identical to m_search above, but returns the number of objects that
match the search instead of returning the objects themselves. Use
this method instead of writing len(self.search(...)).'''
@ -291,7 +291,7 @@ class AbstractWrapper:
contentType = flavour.o.getPortalType(klass)
search = Search('customSearch', **fields)
res = self.tool.o.executeQuery(contentType,flavour.number,search=search,
brainsOnly=True)
brainsOnly=True, noSecurity=noSecurity)
if res: return res._len # It is a LazyMap instance
else: return 0