~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/blueprints/model/specification.py

  • Committer: Michael Hudson
  • Date: 2010-07-27 05:07:09 UTC
  • mto: (11128.11.2)
  • mto: This revision was merged to the branch mainline in revision 11299.
  • Revision ID: michael.hudson@linaro.org-20100727050709-lue5tgfc3w5bhgj8
merge more separate apache config from later pipe

Show diffs side-by-side

added added

removed removed

Lines of Context:
229
229
            # and make sure there is no leftover distroseries goal
230
230
            self.productseries = None
231
231
        else:
232
 
            raise AssertionError('Inappropriate goal.')
 
232
            raise AssertionError, 'Inappropriate goal.'
233
233
        # record who made the proposal, and when
234
234
        self.goal_proposer = proposer
235
235
        self.date_goal_proposed = UTC_NOW
333
333
 
334
334
    # NB NB NB if you change this definition PLEASE update the db constraint
335
335
    # Specification.specification_completion_recorded_chk !!!
336
 
    completeness_clause = ("""
 
336
    completeness_clause =  ("""
337
337
        Specification.implementation_status = %s OR
338
338
        Specification.definition_status IN ( %s, %s ) OR
339
339
        (Specification.implementation_status = %s AND
372
372
    # than a threshold" and to comment the dbschema that "anything not
373
373
    # started should be less than the threshold". We'll see how maintainable
374
374
    # this is.
375
 
    started_clause = """
 
375
    started_clause =  """
376
376
        Specification.implementation_status NOT IN (%s, %s, %s, %s) OR
377
377
        (Specification.implementation_status = %s AND
378
378
         Specification.definition_status = %s)
520
520
                return
521
521
 
522
522
    def isSubscribed(self, person):
523
 
        """See lp.blueprints.interfaces.specification.ISpecification."""
 
523
        """See canonical.launchpad.interfaces.ISpecification."""
524
524
        if person is None:
525
525
            return False
526
526
 
678
678
    def latest_completed_specifications(self):
679
679
        """See IHasSpecifications."""
680
680
        return self.specifications(sort=SpecificationSort.DATE, quantity=5,
681
 
            filter=[SpecificationFilter.COMPLETE, ])
 
681
            filter=[SpecificationFilter.COMPLETE,])
682
682
 
683
683
    @property
684
684
    def specification_count(self):
790
790
 
791
791
        # filter based on completion. see the implementation of
792
792
        # Specification.is_complete() for more details
793
 
        completeness = Specification.completeness_clause
 
793
        completeness =  Specification.completeness_clause
794
794
 
795
795
        if SpecificationFilter.COMPLETE in filter:
796
796
            query += ' AND ( %s ) ' % completeness
859
859
            FROM SpecificationDependency, Specification
860
860
            WHERE SpecificationDependency.specification IN %s
861
861
            AND SpecificationDependency.dependency = Specification.id
862
 
            ORDER BY Specification.priority DESC, Specification.name,
863
 
                     Specification.id
 
862
            ORDER BY Specification.priority DESC, Specification.name, Specification.id
864
863
        """ % sqlvalues(specification_ids)).get_all()
865
864
 
866
865
        dependencies = {}
873
872
        return dependencies
874
873
 
875
874
    def get(self, spec_id):
876
 
        """See lp.blueprints.interfaces.specification.ISpecificationSet."""
 
875
        """See canonical.launchpad.interfaces.ISpecificationSet."""
877
876
        return Specification.get(spec_id)