~gmb/launchpad/bug-644346

« back to all changes in this revision

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

  • Committer: Graham Binns
  • Date: 2010-09-23 08:59:28 UTC
  • mfrom: (11575.1.37 launchpad)
  • Revision ID: graham@canonical.com-20100923085928-4x8vlt72gvzppb11
Merged devel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
from lp.registry.model.karma import KarmaContextMixin
94
94
from lp.registry.model.mentoringoffer import MentoringOffer
95
95
from lp.registry.model.milestone import (
 
96
    HasMilestonesMixin,
96
97
    Milestone,
97
98
    ProjectMilestone,
98
99
    )
110
111
                   MakesAnnouncements, HasSprintsMixin, HasAliasMixin,
111
112
                   KarmaContextMixin, BranchVisibilityPolicyMixin,
112
113
                   StructuralSubscriptionTargetMixin,
113
 
                   HasBranchesMixin, HasMergeProposalsMixin, HasBugHeatMixin):
 
114
                   HasBranchesMixin, HasMergeProposalsMixin, HasBugHeatMixin,
 
115
                   HasMilestonesMixin):
114
116
    """A ProjectGroup"""
115
117
 
116
118
    implements(IProjectGroup, IFAQCollection, IHasBugHeat, IHasIcon, IHasLogo,
309
311
        """Customize `search_params` for this milestone."""
310
312
        search_params.setProject(self)
311
313
 
 
314
    def _getOfficialTagClause(self):
 
315
        """See `OfficialBugTagTargetMixin`."""
 
316
        And(ProjectGroup.id == Product.projectID,
 
317
            Product.id == OfficialBugTag.productID)
 
318
 
312
319
    @property
313
320
    def official_bug_tags(self):
314
321
        """See `IHasBugs`."""
396
403
        """
397
404
        return self.products.count() != 0
398
405
 
 
406
    def _getMilestoneCondition(self):
 
407
        """See `HasMilestonesMixin`."""
 
408
        return And(Milestone.productID == Product.id,
 
409
                   Product.projectID == self.id)
 
410
 
399
411
    def _getMilestones(self, only_active):
400
412
        """Return a list of milestones for this project group.
401
413
 
445
457
        return self._getMilestones(True)
446
458
 
447
459
    @property
 
460
    def product_milestones(self):
 
461
        """Hack to avoid the ProjectMilestone in MilestoneVocabulary."""
 
462
        # XXX: bug=644977 Robert Collins - this is a workaround for
 
463
        # insconsistency in project group milestone use.
 
464
        return self._get_milestones()
 
465
 
 
466
    @property
448
467
    def all_milestones(self):
449
468
        """See `IProjectGroup`."""
450
469
        return self._getMilestones(False)