Revision 2833
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql_gen.py | ||
---|---|---|
250 | 250 |
if isinstance(col, NamedCol): col = col.code |
251 | 251 |
return col |
252 | 252 |
|
253 |
class NoUnderlyingTableException(Exception): pass |
|
254 |
|
|
253 | 255 |
def underlying_col(col): |
254 | 256 |
col = remove_col_rename(col) |
255 |
col = Col(col.name, remove_table_rename(col.table), col.srcs) |
|
256 |
return col |
|
257 |
table = remove_table_rename(col.table) |
|
258 |
if not is_underlying_table(table): raise NoUnderlyingTableException |
|
259 |
return Col(col.name, table, col.srcs) |
|
257 | 260 |
|
258 | 261 |
def wrap(wrap_func, value): |
259 | 262 |
'''Wraps a value, propagating any column renaming to the returned value.''' |
Also available in: Unified diff
sql_gen.py: underlying_col(): If no underlying table, raise NoUnderlyingTableException