83def search(query, params):
88 'wildcard':
r'%' + query.replace(
' ',
r'%') +
r'%',
90 'offset': (params[
'pageno'] - 1) * limit,
92 query_to_run = query_str +
' LIMIT :limit OFFSET :offset'
96 cur.execute(query_to_run, query_params)
97 col_names = [cn[0]
for cn
in cur.description]
99 for row
in cur.fetchall():
100 item = dict(zip(col_names, map(str, row)))
101 item[
'template'] = result_template
102 logger.debug(
"append result --> %s", item)