Revision 3016
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql_gen.py | ||
---|---|---|
179 | 179 |
def __init__(self, name, code, cols=None): |
180 | 180 |
Table.__init__(self, name) |
181 | 181 |
|
182 |
if not isinstance(code, Code): code = Table(code)
|
|
182 |
code = as_Table(code)
|
|
183 | 183 |
if not isinstance(code, (Table, FunctionCall, Expr)): code = Expr(code) |
184 | 184 |
if cols != None: cols = map(to_name_only_col, cols) |
185 | 185 |
|
... | ... | |
277 | 277 |
def __init__(self, name, code): |
278 | 278 |
Col.__init__(self, name) |
279 | 279 |
|
280 |
if not isinstance(code, Code): code = Literal(code)
|
|
280 |
code = as_Value(code)
|
|
281 | 281 |
|
282 | 282 |
self.code = code |
283 | 283 |
|
... | ... | |
345 | 345 |
''' |
346 | 346 |
@param args [Code|literal-value...] The function's arguments |
347 | 347 |
''' |
348 |
if not isinstance(function, Code): function = Function(function)
|
|
348 |
function = as_Function(function)
|
|
349 | 349 |
def filter_(arg): return remove_col_rename(as_Value(arg)) |
350 | 350 |
args = map(filter_, args) |
351 | 351 |
args += [NamedArg(k, filter_(v)) for k, v in kw_args.iteritems()] |
Also available in: Unified diff
sql_gen.py: Use an as_*() function instead of manually checking the type wherever possible