Project

General

Profile

« Previous | Next » 

Revision 3521

sql_gen.py: Added List and inherit from it in Tuple

View differences:

lib/sql_gen.py
153 153

  
154 154
#### Composites
155 155

  
156
class Tuple(Code):
157
    def __init__(self, *values):
156
class List(Code):
157
    def __init__(self, values):
158 158
        Code.__init__(self)
159 159
        
160 160
        self.values = values
161 161
    
162
    def to_str(self, db):
163
        return '('+(', '.join((v.to_str(db) for v in self.values)))+')'
162
    def to_str(self, db): return ', '.join((v.to_str(db) for v in self.values))
164 163

  
164
class Tuple(List):
165
    def __init__(self, *values):
166
        List.__init__(self, values)
167
    
168
    def to_str(self, db): return '('+List.to_str(self, db)+')'
169

  
165 170
class Row(Tuple):
166 171
    def to_str(self, db): return 'ROW'+Tuple.to_str(self, db)
167 172

  

Also available in: Unified diff