Project

General

Profile

« Previous | Next » 

Revision 2563

sql_gen.py: as_Col(): Added optional name param to specify that non-Col input will be renamed using NamedCol with the given name

View differences:

sql_gen.py
116 116

  
117 117
def is_table_col(col): return col.table != None
118 118

  
119
def as_Col(col, table=None):
120
    assert col != None
119
def as_Col(col, table=None, name=None):
120
    '''
121
    @param name If not None, any non-Col input will be renamed using NamedCol.
122
    '''
123
    if name != None:
124
        col = as_Value(col)
125
        if not isinstance(col, Col): col = NamedCol(name, col)
121 126
    
122 127
    if isinstance(col, Code): return col
123 128
    else: return Col(col, table)

Also available in: Unified diff