From: root Date: Mon, 09 Dec 2013 09:29:41 +0000 Subject: Fix total datasets X-Git-Url: http://maxious.lambdacomplex.org/git/?p=ckanext-dga-stats.git&a=commitdiff&h=3bc3ba064bb9e8050379566b8dd8789a465db0f1 --- Fix total datasets --- --- a/ckanext/dga_stats/stats.py +++ b/ckanext/dga_stats/stats.py @@ -124,8 +124,9 @@ def summary_stats(cls): connection = model.Session.connection() +# select 'Total Archived Datasets', count(*) from package where (state='active' or state='draft' or state='draft-complete') and private = 't' union \ res = connection.execute("SELECT 'Total Organisations', count(*) from \"group\" where type = 'organization' and state = 'active' union \ - select 'Total Datasets', count(*) from package where state='active' or state='draft' or state='draft-complete' union \ + select 'Total Datasets', count(*) from package where (state='active' or state='draft' or state='draft-complete') and private = 'f' union \ select 'Total Data Files/Resources', count(*) from resource where state='active'").fetchall(); return res