Project

General

Profile

« Previous | Next » 

Revision 2933

sql_gen.py: Col.__str__(): Truncate any table name using concat() to ensure that the full column name is included in the string

View differences:

lib/sql_gen.py
206 206
        self.name = name
207 207
        self.table = table
208 208
    
209
    def to_str(self, db):
210
        str_ = ''
211
        if self.table != None: str_ += self.table.to_Table().to_str(db)+'.'
212
        str_ += db.esc_name(self.name)
209
    def to_str(self, db, use_concat=False):
210
        str_ = db.esc_name(self.name)
211
        if self.table != None:
212
            str_ = '.'+str_
213
            table_str = self.table.to_Table().to_str(db)
214
            if use_concat: str_ = concat(table_str, str_)
215
            else: str_ = table_str+str_
213 216
        return str_
214 217
    
218
    def __str__(self): return clean_name(self.to_str(mockDb, use_concat=True))
219
    
215 220
    def to_Col(self): return self
216 221

  
217 222
def is_table_col(col): return isinstance(col, Col) and col.table != None

Also available in: Unified diff