fixed(?) count(*) problem in grid

This commit is contained in:
mdipierro
2013-08-07 04:14:18 -05:00
parent db9ff09ae7
commit 90069aacda
4 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.6.0-development+timestamp.2013.08.06.17.14.00
Version 2.6.0-development+timestamp.2013.08.07.04.13.27
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3 -2
View File
@@ -1834,11 +1834,12 @@ class SQLFORM(FORM):
## if it's not an integer
if cache_count is None or isinstance(cache_count, tuple):
if groupby:
c = 'count(*)'
c = 'count(*) _tmp'
nrows = db.executesql(
'select count(*) from (%s);' %
dbset._select(c, left=left, cacheable=True,
groupby=groupby, cache=cache_count)[:-1])[0][0]
groupby=groupby,
cache=cache_count)[:-1])[0][0]
elif left:
c = 'count(*)'
nrows = dbset.select(c, left=left, cacheable=True, cache=cache_count).first()[c]