Here are the examples of the python api web.utils.iters taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
3
Example 1
Project: mailer Source File: utils.py
def sqlands(left, lst):
"""Similar to webpy sqlors but for ands"""
if isinstance(lst, web.utils.iters):
lst = list(lst)
ln = len(lst)
if ln == 0:
return web.SQLQuery("1!=2")
if ln == 1:
lst = lst[0]
if isinstance(lst, web.utils.iters):
return web.SQLQuery(['('] +
sum([[left, web.sqlparam(x), ' AND '] for x in lst], []) +
['1!=2)']
)
else:
return left + web.sqlparam(lst)