allows strings as select args, thanks dhx

This commit is contained in:
mdipierro
2012-08-09 08:57:58 -05:00
parent 3607b960a3
commit 1906817df8
2 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.00.0 (2012-08-08 22:33:45) dev Version 2.00.0 (2012-08-09 08:57:54) dev
+6
View File
@@ -1312,6 +1312,12 @@ class BaseAdapter(ConnectionPool):
for item in fields: for item in fields:
if isinstance(item,SQLALL): if isinstance(item,SQLALL):
new_fields += item._table new_fields += item._table
elif isinstance(item,str):
if regex_table_field.match(item):
tablename,fieldname = item.split('.')
new_fields.append(self.db[tablename][fieldname])
else:
new_fields.append(Expression(self.db,item))
else: else:
new_fields.append(item) new_fields.append(item)
# ## if no fields specified take them all from the requested tables # ## if no fields specified take them all from the requested tables