~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Julian Edwards
  • Date: 2011-07-28 20:46:18 UTC
  • mfrom: (13553 devel)
  • mto: This revision was merged to the branch mainline in revision 13555.
  • Revision ID: julian.edwards@canonical.com-20110728204618-tivj2wx2oa9s32bx
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    sqlvalues,
38
38
    )
39
39
from canonical.launchpad.helpers import shortlist
40
 
from lp.app.interfaces.launchpad import (
 
40
from canonical.launchpad.interfaces.launchpad import (
41
41
    IHasIcon,
42
42
    IHasLogo,
43
43
    IHasMugshot,
68
68
from lp.blueprints.model.sprint import HasSprintsMixin
69
69
from lp.bugs.interfaces.bugsummary import IBugSummaryDimension
70
70
from lp.bugs.interfaces.bugtarget import IHasBugHeat
71
 
from lp.bugs.model.bug import get_bug_tags
 
71
from lp.bugs.model.bug import (
 
72
    get_bug_tags,
 
73
    )
72
74
from lp.bugs.model.bugtarget import (
73
75
    BugTargetBase,
74
76
    HasBugHeatMixin,
75
77
    OfficialBugTag,
76
78
    )
 
79
from lp.bugs.model.bugtask import BugTask
77
80
from lp.bugs.model.structuralsubscription import (
78
81
    StructuralSubscriptionTargetMixin,
79
82
    )
82
85
    HasBranchesMixin,
83
86
    HasMergeProposalsMixin,
84
87
    )
85
 
from lp.registry.interfaces.person import (
86
 
    validate_person_or_closed_team,
87
 
    validate_public_person,
88
 
    )
 
88
from lp.registry.interfaces.person import validate_public_person
89
89
from lp.registry.interfaces.pillar import IPillarNameSet
90
90
from lp.registry.interfaces.product import IProduct
91
91
from lp.registry.interfaces.projectgroup import (
128
128
    # db field names
129
129
    owner = ForeignKey(
130
130
        dbName='owner', foreignKey='Person',
131
 
        storm_validator=validate_person_or_closed_team, notNull=True)
 
131
        storm_validator=validate_public_person, notNull=True)
132
132
    registrant = ForeignKey(
133
133
        dbName='registrant', foreignKey='Person',
134
134
        storm_validator=validate_public_person, notNull=True)
171
171
    max_bug_heat = Int()
172
172
 
173
173
    @property
174
 
    def pillar_category(self):
175
 
        """See `IPillar`."""
176
 
        return "Project Group"
177
 
 
178
 
    @property
179
174
    def products(self):
180
175
        return Product.selectBy(
181
176
            project=self, active=True, orderBy='displayname')
202
197
            Join(ProductSeries, Product.id == ProductSeries.productID),
203
198
            Join(POTemplate, ProductSeries.id == POTemplate.productseriesID),
204
199
            ]
 
200
        # XXX j.c.sackett 2010-11-19 bug=677532 It's less than ideal that
 
201
        # this query is using _translations_usage, but there's no cleaner
 
202
        # way to deal with it. Once the bug above is resolved, this should
 
203
        # should be fixed to use translations_usage.
205
204
        return store.using(*origin).find(
206
205
            Product,
207
206
            Product.project == self.id,
208
 
            Product.translations_usage == ServiceUsage.LAUNCHPAD,
 
207
            Product._translations_usage == ServiceUsage.LAUNCHPAD,
209
208
            ).config(distinct=True)
210
209
 
211
210
    def has_translatable(self):