~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/model/projectgroup.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-06-08 00:14:25 UTC
  • mfrom: (13165.2.2 bug-793809)
  • Revision ID: launchpad@pqm.canonical.com-20110608001425-i7noud89pt3iy93y
[r=wgrant][bug=793809] Use BugSummary to do tag portlet calculations

Show diffs side-by-side

added added

removed removed

Lines of Context:
343
343
        return get_bug_tags(
344
344
            "BugTask.product IN (%s)" % ",".join(product_ids))
345
345
 
346
 
    def getUsedBugTagsWithOpenCounts(self, user, wanted_tags=None):
347
 
        """See `IHasBugs`."""
348
 
        if not self.products:
349
 
            return []
 
346
    def getUsedBugTagsWithOpenCounts(self, user, tag_limit=0, include_tags=None):
 
347
        """See IBugTarget."""
 
348
        # Circular fail.
 
349
        from lp.bugs.model.bugsummary import BugSummary
350
350
        product_ids = [product.id for product in self.products]
 
351
        if not product_ids:
 
352
            return {}
351
353
        return get_bug_tags_open_count(
352
 
            BugTask.productID.is_in(product_ids), user,
353
 
            wanted_tags=wanted_tags)
 
354
            BugSummary.product_id.is_in(product_ids),
 
355
            user, tag_limit=tag_limit, include_tags=include_tags)
354
356
 
355
357
    def _getBugTaskContextClause(self):
356
358
        """See `HasBugsBase`."""