Project

General

Profile

« Previous | Next » 

Revision 2176

sql.py: mk_select(): Make tuple optional for None literal values

View differences:

lib/sql.py
391 391
    
392 392
    def parse_col(field, default_table=None):
393 393
        '''Parses fields'''
394
        if field == None: field = (field,) # for None values, tuple is optional
394 395
        is_tuple = isinstance(field, tuple)
395 396
        if is_tuple and len(field) == 1: # field is literal value
396 397
            value, = field
......
430 431
            right_col = table+'.'+esc_name_(right_col)
431 432
            sql_ = right_col+' '
432 433
            
434
            if left_col == None: left_col = (left_col,)
435
                # for None values, tuple is optional
433 436
            if isinstance(left_col, tuple) and len(left_col) == 1:
434 437
                # col is literal value
435 438
                value, = left_col

Also available in: Unified diff