From 0575a80e7a4474251d8a081f23589dd8bf80d9d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Fri, 3 Jan 2014 13:25:23 +0100 Subject: [PATCH] Now issues filters are ordered by order and returned as a list of tuples --- greenmine/projects/aggregates/filters.py | 25 ++++++++++++------------ 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/greenmine/projects/aggregates/filters.py b/greenmine/projects/aggregates/filters.py index 56188c25..548eb098 100644 --- a/greenmine/projects/aggregates/filters.py +++ b/greenmine/projects/aggregates/filters.py @@ -14,7 +14,7 @@ def _get_issues_tags(project): cursor.execute(extra_sql, [project.id]) rows = cursor.fetchall() - return dict(rows) + return rows def _get_issues_statuses(project): extra_sql = ("select status_id, count(status_id) from issues_issue " @@ -24,14 +24,14 @@ def _get_issues_statuses(project): select id, (select count(*) from issues_issue where project_id = m.project_id and status_id = m.id) from projects_issuestatus as m - where project_id = %s; + where project_id = %s order by m.order; """ with closing(connection.cursor()) as cursor: cursor.execute(extra_sql, [project.id]) rows = cursor.fetchall() - return dict(rows) + return rows def _get_issues_priorities(project): @@ -39,29 +39,28 @@ def _get_issues_priorities(project): select id, (select count(*) from issues_issue where project_id = m.project_id and priority_id = m.id) from projects_priority as m - where project_id = %s; + where project_id = %s order by m.order; """ with closing(connection.cursor()) as cursor: cursor.execute(extra_sql, [project.id]) rows = cursor.fetchall() - return dict(rows) - + return rows def _get_issues_types(project): extra_sql = """ select id, (select count(*) from issues_issue where project_id = m.project_id and type_id = m.id) from projects_issuetype as m - where project_id = %s; + where project_id = %s order by m.order; """ with closing(connection.cursor()) as cursor: cursor.execute(extra_sql, [project.id]) rows = cursor.fetchall() - return dict(rows) + return rows def _get_issues_severities(project): @@ -69,14 +68,14 @@ def _get_issues_severities(project): select id, (select count(*) from issues_issue where project_id = m.project_id and severity_id = m.id) from projects_severity as m - where project_id = %s; + where project_id = %s order by m.order; """ with closing(connection.cursor()) as cursor: cursor.execute(extra_sql, [project.id]) rows = cursor.fetchall() - return dict(rows) + return rows def _get_issues_assigned_to(project): @@ -91,7 +90,7 @@ def _get_issues_assigned_to(project): cursor.execute(extra_sql, [project.id]) rows = cursor.fetchall() - return dict(rows) + return rows def _get_issues_owners(project): @@ -106,7 +105,7 @@ def _get_issues_owners(project): cursor.execute(extra_sql, [project.id]) rows = cursor.fetchall() - return dict(rows) + return rows def _get_issues_created_by(project): @@ -121,7 +120,7 @@ def _get_issues_created_by(project): cursor.execute(extra_sql, [project.id]) rows = cursor.fetchall() - return dict(rows) + return rows def get_issues_filters_data(project):