Project

General

Profile

« Previous | Next » 

Revision 2577

sql_gen.py: Added combine_conds() and use it in Join.to_str() and sql.py mk_select()

View differences:

sql.py
511 511
    if conds != []:
512 512
        if len(conds) == 1: whitespace = ' '
513 513
        else: whitespace = '\n'
514
        query += '\nWHERE'+whitespace+('\nAND '.join((
515
            '('+sql_gen.ColValueCond(l, r) .to_str(db)+')' for l, r in conds)))
514
        query += '\n'+sql_gen.combine_conds(['('+sql_gen.ColValueCond(l, r)
515
            .to_str(db)+')' for l, r in conds], 'WHERE')
516 516
        missing = False
517 517
    if order_by != None:
518 518
        query += '\nORDER BY '+sql_gen.as_Col(order_by, table0).to_str(db)

Also available in: Unified diff