~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/model/distroseries.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:
28
28
    StringCol,
29
29
    )
30
30
from storm.locals import (
 
31
    And,
31
32
    Desc,
32
33
    Join,
33
34
    SQL,
853
854
        """See `IHasBugs`."""
854
855
        return get_bug_tags("BugTask.distroseries = %s" % sqlvalues(self))
855
856
 
856
 
    def getUsedBugTagsWithOpenCounts(self, user, wanted_tags=None):
857
 
        """See `IHasBugs`."""
 
857
    def getUsedBugTagsWithOpenCounts(self, user, tag_limit=0, include_tags=None):
 
858
        """See IBugTarget."""
 
859
        # Circular fail.
 
860
        from lp.bugs.model.bugsummary import BugSummary
858
861
        return get_bug_tags_open_count(
859
 
            BugTask.distroseries == self, user, wanted_tags=wanted_tags)
 
862
            And(
 
863
                BugSummary.distroseries_id == self.id,
 
864
                BugSummary.sourcepackagename_id == None
 
865
                ),
 
866
            user, tag_limit=tag_limit, include_tags=include_tags)
860
867
 
861
868
    @property
862
869
    def has_any_specifications(self):