← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~cjwatson/launchpad/git-recipe-find into lp:launchpad

 

Review: Approve code



Diff comments:

> 
> === modified file 'lib/lp/registry/model/product.py'
> --- lib/lp/registry/model/product.py	2015-10-01 17:32:41 +0000
> +++ lib/lp/registry/model/product.py	2016-01-12 04:14:12 +0000
> @@ -1578,8 +1580,18 @@
>              SourcePackageRecipe,
>              SourcePackageRecipe.id ==
>                  SourcePackageRecipeData.sourcepackage_recipe_id,
> -            SourcePackageRecipeData.base_branch == Branch.id,
> -            Branch.product == self)
> +            SourcePackageRecipeData.id.is_in(Union(
> +                Select(
> +                    SourcePackageRecipeData.id,
> +                    And(
> +                        SourcePackageRecipeData.base_branch == Branch.id,
> +                        Branch.product == self)),
> +                Select(
> +                    SourcePackageRecipeData.id,
> +                    And(
> +                        SourcePackageRecipeData.base_git_repository ==
> +                            GitRepository.id,
> +                        GitRepository.project == self)))))

This is a bit weird. Are the unioned subselects for performance, or would a simpler to optimise double left join suffice?

>          hook = SourcePackageRecipe.preLoadDataForSourcePackageRecipes
>          return DecoratedResultSet(recipes, pre_iter_hook=hook)
>  


-- 
https://code.launchpad.net/~cjwatson/launchpad/git-recipe-find/+merge/282255
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.


References