~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/model/archive.py

[r=benji][bug=848097] add another filter to
        IArchive.getPublishedSources;
        make it possible to filter by component name

Show diffs side-by-side

added added

removed removed

Lines of Context:
495
495
    def getPublishedSources(self, name=None, version=None, status=None,
496
496
                            distroseries=None, pocket=None,
497
497
                            exact_match=False, created_since_date=None,
498
 
                            eager_load=False):
 
498
                            eager_load=False, component_name=None):
499
499
        """See `IArchive`."""
500
500
        # clauses contains literal sql expressions for things that don't work
501
501
        # easily in storm : this method was migrated from sqlobject but some
535
535
        else:
536
536
            orderBy.insert(1, Desc(SourcePackageRelease.version))
537
537
 
 
538
        if component_name is not None:
 
539
            storm_clauses.extend(
 
540
                [SourcePackagePublishingHistory.componentID == Component.id,
 
541
                 Component.name == component_name,
 
542
                 ])
 
543
 
538
544
        if status is not None:
539
545
            try:
540
546
                status = tuple(status)