Revision 3093
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql_gen.py | ||
---|---|---|
266 | 266 |
if isinstance(col, Code): return col |
267 | 267 |
else: return Col(col, table) |
268 | 268 |
|
269 |
def with_table(col, table): |
|
270 |
col = copy.copy(col) # don't modify input! |
|
271 |
col.table = table |
|
272 |
return col |
|
273 |
|
|
269 | 274 |
def with_default_table(col, table, overwrite=False): |
270 | 275 |
col = as_Col(col) |
271 | 276 |
if not isinstance(col, NamedCol) and (overwrite or col.table == None): |
272 |
col = copy.copy(col) # don't modify input! |
|
273 |
col.table = table |
|
277 |
col = with_table(col, table) |
|
274 | 278 |
return col |
275 | 279 |
|
276 | 280 |
def set_cols_table(table, cols): |
Also available in: Unified diff
sql_gen.py: Added with_table() and use it in with_default_table()