StandardInput=tty
StandardOutput=tty
TTYPath=/dev/tty1
params = []
s = "select * from table "
s += "where 1=1 "
if request.form['param1'] != 'Все':
s += "and one = %s "
params.append(request.form['param1'])
if request.form['param2'] != 'Все':
s += "and two = %s "
params.append(request.form['param2'])
if request.form['param3'] != 'Все':
s += "and three = %s"
params.append(request.form['param3'])
rows = cursor.execute(s, tuple(params))