Project

General

Profile

« Previous | Next » 

Revision 2815

sql_gen.py: as_Code(): Added optional db param, which causes the function to run db.std_code() on the value to fix the syntax

View differences:

sql_gen.py
66 66
    
67 67
    def to_str(self, db): return self.str_
68 68

  
69
def as_Code(value):
70
    if util.is_str(value): return CustomCode(value)
69
def as_Code(value, db=None):
70
    '''
71
    @param db If set, runs db.std_code() on the value.
72
    '''
73
    if util.is_str(value):
74
        if db != None: value = db.std_code(value)
75
        return CustomCode(value)
71 76
    else: return Literal(value)
72 77

  
73 78
class Expr(Code):

Also available in: Unified diff