Merge pull request #521 from janknaupato/master
Fix for issue 1932: Aggregrate function won't show up in SQLTABLE
This commit is contained in:
+8
-4
@@ -3033,12 +3033,16 @@ class SQLTABLE(TABLE):
|
|||||||
return
|
return
|
||||||
REGEX_TABLE_DOT_FIELD = sqlrows.db._adapter.REGEX_TABLE_DOT_FIELD
|
REGEX_TABLE_DOT_FIELD = sqlrows.db._adapter.REGEX_TABLE_DOT_FIELD
|
||||||
if not columns:
|
if not columns:
|
||||||
columns = [c for c in sqlrows.colnames if REGEX_TABLE_DOT_FIELD.match(c)]
|
columns = list(sqlrows.colnames)
|
||||||
if headers == 'fieldname:capitalize':
|
if headers == 'fieldname:capitalize':
|
||||||
headers = {}
|
headers = {}
|
||||||
for c in columns:
|
for c in columns:
|
||||||
(t, f) = REGEX_TABLE_DOT_FIELD.match(c).groups()
|
tfmatch=REGEX_TABLE_DOT_FIELD.match(c)
|
||||||
headers[t + '.' + f] = f.replace('_', ' ').title()
|
if tfmatch:
|
||||||
|
(t, f) = REGEX_TABLE_DOT_FIELD.match(c).groups()
|
||||||
|
headers[t + '.' + f] = f.replace('_', ' ').title()
|
||||||
|
else:
|
||||||
|
headers[c]=c
|
||||||
elif headers == 'labels':
|
elif headers == 'labels':
|
||||||
headers = {}
|
headers = {}
|
||||||
for c in columns:
|
for c in columns:
|
||||||
@@ -3057,7 +3061,7 @@ class SQLTABLE(TABLE):
|
|||||||
headers = {}
|
headers = {}
|
||||||
else:
|
else:
|
||||||
for c in columns: # new implement dict
|
for c in columns: # new implement dict
|
||||||
c = '.'.join(REGEX_TABLE_DOT_FIELD.match(c).groups())
|
c = str(c)
|
||||||
if isinstance(headers.get(c, c), dict):
|
if isinstance(headers.get(c, c), dict):
|
||||||
coldict = headers.get(c, c)
|
coldict = headers.get(c, c)
|
||||||
attrcol = dict()
|
attrcol = dict()
|
||||||
|
|||||||
Reference in New Issue
Block a user