~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

[rs=buildbot-poller] automatic merge from stable. Revisions: 14116,
        14117, 14118, 14119, 14120 included.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
# pylint: disable-msg=E0611,W0212
68
68
    ISeriesBugTarget,
69
69
    )
70
70
from lp.bugs.interfaces.bugtaskfilter import OrderedBugTask
71
 
from lp.bugs.model.bug import (
72
 
    get_bug_tags,
73
 
    )
 
71
from lp.bugs.model.bug import get_bug_tags
74
72
from lp.bugs.model.bugtarget import (
75
73
    BugTargetBase,
76
74
    HasBugHeatMixin,
77
75
    )
78
 
from lp.bugs.model.bugtask import BugTask
79
76
from lp.bugs.model.structuralsubscription import (
80
77
    StructuralSubscriptionTargetMixin,
81
78
    )
581
578
            origin = [Language, POFile, POTemplate]
582
579
            query = store.using(*origin).find(
583
580
                (Language, POFile),
584
 
                POFile.language==Language.id,
585
 
                Language.visible==True,
586
 
                POFile.potemplate==POTemplate.id,
587
 
                POTemplate.productseries==self,
588
 
                POTemplate.iscurrent==True,
589
 
                Language.id!=english.id)
 
581
                POFile.language == Language.id,
 
582
                Language.visible == True,
 
583
                POFile.potemplate == POTemplate.id,
 
584
                POTemplate.productseries == self,
 
585
                POTemplate.iscurrent == True,
 
586
                Language.id != english.id)
590
587
 
591
588
            ordered_results = query.order_by(['Language.englishname'])
592
589
 
605
602
        else:
606
603
            # If there is more than one template, do a single
607
604
            # query to count total messages in all templates.
608
 
            query = store.find(Sum(POTemplate.messagecount),
609
 
                                POTemplate.productseries==self,
610
 
                                POTemplate.iscurrent==True)
 
605
            query = store.find(
 
606
                Sum(POTemplate.messagecount),
 
607
                POTemplate.productseries == self,
 
608
                POTemplate.iscurrent == True)
611
609
            total, = query
612
610
            # And another query to fetch all Languages with translations
613
611
            # in this ProductSeries, along with their cumulative stats
620
618
                 Sum(POFile.rosettacount),
621
619
                 Sum(POFile.unreviewed_count),
622
620
                 Max(POFile.date_changed)),
623
 
                POFile.language==Language.id,
624
 
                Language.visible==True,
625
 
                POFile.potemplate==POTemplate.id,
626
 
                POTemplate.productseries==self,
627
 
                POTemplate.iscurrent==True,
628
 
                Language.id!=english.id).group_by(Language)
 
621
                POFile.language == Language.id,
 
622
                Language.visible == True,
 
623
                POFile.potemplate == POTemplate.id,
 
624
                POTemplate.productseries == self,
 
625
                POTemplate.iscurrent == True,
 
626
                Language.id != english.id).group_by(Language)
629
627
 
630
628
            ordered_results = query.order_by(['Language.englishname'])
631
629