1. Olemis Lang
  2. bloodhound-mq

Commits

Olemis Lang  committed f7f5b65

BH Dashboard #552 : Adding some columns in query URL and filtering status=!closed ...

... thus matching ticket count in corresponding product box

  • Participants
  • Parent commits c0abdc8
  • Branches t552_product_widget_href

Comments (0)

Files changed (1)

File t552/t552_r_product_widget_href.diff

View file
  • Ignore whitespace
 
 diff -r 99489e0a8ef7 bloodhound_dashboard/bhdashboard/widgets/product.py
 --- a/bloodhound_dashboard/bhdashboard/widgets/product.py	Wed Jul 03 02:40:48 2013 +0000
-+++ b/bloodhound_dashboard/bhdashboard/widgets/product.py	Sun Jul 07 00:36:52 2013 -0500
++++ b/bloodhound_dashboard/bhdashboard/widgets/product.py	Sun Jul 07 01:01:08 2013 -0500
 @@ -36,7 +36,6 @@
  from bhdashboard.util import WidgetBase, check_widget_name, pretty_wrapper
  
  
  
  __metaclass__ = type
-@@ -59,7 +58,7 @@
+@@ -57,9 +56,12 @@
  
+     get_widget_params = pretty_wrapper(get_widget_params, check_widget_name)
+ 
++    COMMON_QUERY = 'order=priority&status=!closed&col=id&col=summary&col=owner&' \
++                   'col=type&col=status&col=priority&col=product'
++
      def _get_product_info(self, product, resource, max_):
          penv = ProductEnvironment(self.env, product.prefix)
 -        href = ProductizedHref(self.env, penv.href.base)
          results = []
  
          # some queries return a list/tuple, some a generator,
-@@ -119,7 +118,7 @@
+@@ -73,8 +75,9 @@
+         query = resource['type'].select(penv)
+         for q in itertools.islice(query, max_):
+             q.url = href(resource['name'], q.name) if resource.get('hrefurl') \
+-                else Query.from_string(penv, 'order=priority&%s=%s' %
+-                    (resource['name'], q.name)).get_href(href)
++                else Query.from_string(penv, '%s=%s&%s&col=%s' %
++                    (resource['name'], q.name, self.COMMON_QUERY, 
++                     resource['name'])).get_href(href)
+             q.ticket_count = penv.db_query(
+                 """SELECT COUNT(*) FROM ticket WHERE ticket.%s='%s'
+                    AND ticket.status <> 'closed'""" % (resource['name'], q.name))[0][0]
+@@ -119,7 +122,7 @@
          params = ('max', )
          max_, = self.bind_params(name, options, *params)