Revision 2564
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql_gen.py | ||
---|---|---|
152 | 152 |
if isinstance(col, NamedCol): col = col.code |
153 | 153 |
return col |
154 | 154 |
|
155 |
class ColDict(dict): |
|
156 |
'''A dict that automatically makes inserted entries Col objects''' |
|
157 |
|
|
158 |
def __setitem__(self, key, value): |
|
159 |
return dict.__setitem__(self, key, as_Col(value, name=key)) |
|
160 |
|
|
161 |
def update(self, dict_): |
|
162 |
for key, value in dict_.iteritems(): self[key] = value |
|
163 |
|
|
155 | 164 |
##### Functions |
156 | 165 |
|
157 | 166 |
class Function(Table): pass |
Also available in: Unified diff
sql_gen.py: Added ColDict