Project

General

Profile

« Previous | Next » 

Revision 3086

sql_gen.py: Added Name class and associated functions

View differences:

sql_gen.py
90 90
    
91 91
    def to_str(self, db): return '('+self.expr.to_str(db)+')'
92 92

  
93
##### Names
94

  
95
class Name(Code):
96
    def __init__(self, name): self.name = name
97
    
98
    def to_str(self, db): return db.esc_name(self.name)
99

  
100
def as_Name(value):
101
    if isinstance(value, Code): return value
102
    else: return Name(value)
103

  
93 104
##### Literal values
94 105

  
95 106
class Literal(Code):

Also available in: Unified diff