incubator-bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g..@apache.org
Subject svn commit: r1351295 - /incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/ticket.py
Date Mon, 18 Jun 2012 11:09:30 GMT
Author: gjm
Date: Mon Jun 18 11:09:29 2012
New Revision: 1351295

URL: http://svn.apache.org/viewvc?rev=1351295&view=rev
Log:
dashboard: correct couter for empty values when query arg is not set - towards #93 (from olemis)

Modified:
    incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/ticket.py

Modified: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/ticket.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/ticket.py?rev=1351295&r1=1351294&r2=1351295&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/ticket.py (original)
+++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/ticket.py Mon Jun
18 11:09:29 2012
@@ -156,11 +156,13 @@ class TicketFieldCloudWidget(WidgetBase)
                     raise InvalidWidgetArgument('field', 
                             'Unknown ticket field %s' % (fieldnm,))
             if field.get('custom'):
-                sql = "SELECT value, count(value) FROM ticket_custom " \
-                        "WHERE name='%(name)s' GROUP BY value"
+                sql = "SELECT COALESCE(value, ''), count(COALESCE(value, ''))" \
+                        " FROM ticket_custom " \
+                        " WHERE name='%(name)s' GROUP BY COALESCE(value, '')"
             else:
-                sql = "SELECT %(name)s, count(%(name)s) FROM ticket " \
-                        "GROUP BY %(name)s"
+                sql = "SELECT COALESCE(%(name)s, ''), " \
+                        "count(COALESCE(%(name)s, '')) FROM ticket " \
+                        "GROUP BY COALESCE(%(name)s, '')"
             sql = sql % field
             # TODO : Implement threshold and max
             db = self.env.get_db_cnx()



Mime
View raw message