launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #17729
[Merge] lp:~cjwatson/launchpad/questionsearch-projectgroup into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/questionsearch-projectgroup into lp:launchpad.
Commit message:
Rename QuestionSearch.project to QuestionSearch.projectgroup.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #523054 in Launchpad itself: "Rename Product.project to Product.projectgroup"
https://bugs.launchpad.net/launchpad/+bug/523054
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/questionsearch-projectgroup/+merge/247861
Rename QuestionSearch.project to QuestionSearch.projectgroup.
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/questionsearch-projectgroup into lp:launchpad.
=== modified file 'lib/lp/answers/model/question.py'
--- lib/lp/answers/model/question.py 2013-07-12 06:14:22 +0000
+++ lib/lp/answers/model/question.py 2015-01-28 16:27:09 +0000
@@ -869,7 +869,7 @@
def __init__(self, search_text=None, needs_attention_from=None, sort=None,
status=QUESTION_STATUS_DEFAULT_SEARCH, language=None,
product=None, distribution=None, sourcepackagename=None,
- project=None):
+ projectgroup=None):
self.search_text = search_text
self.nl_phrase_used = False
@@ -892,7 +892,7 @@
self.product = product
self.distribution = distribution
self.sourcepackagename = sourcepackagename
- self.project = project
+ self.projectgroup = projectgroup
def getTargetConstraints(self):
"""Return the constraints related to the IQuestionTarget context."""
@@ -912,10 +912,10 @@
constraints.append(
'Question.sourcepackagename = %s' % sqlvalues(
self.sourcepackagename))
- elif self.project:
+ elif self.projectgroup:
constraints.append("""
Question.product = Product.id AND Product.active AND
- Product.project = %s""" % sqlvalues(self.project))
+ Product.project = %s""" % sqlvalues(self.projectgroup))
return constraints
@@ -923,7 +923,7 @@
"""Return the tables that should be joined for the constraints."""
if self.needs_attention_from:
return self.getMessageJoins(self.needs_attention_from)
- elif self.project:
+ elif self.projectgroup:
return self.getProductJoins()
else:
return []
@@ -935,14 +935,14 @@
("""LEFT OUTER JOIN QuestionMessage
ON QuestionMessage.question = Question.id
AND QuestionMessage.owner = %s""" % sqlvalues(person))]
- if self.project:
+ if self.projectgroup:
joins.extend(self.getProductJoins())
return joins
def getProductJoins(self):
- """Create the joins needed to select contrains on progects by a
- particular project."""
+ """Create the joins needed to select constraints on projects by a
+ particular project group."""
return [('JOIN Product '
'ON Question.product = Product.id')]
@@ -988,8 +988,8 @@
# The idea is to prejoin all dependant tables, except if the
# object will be the same in all rows because it is used as a
# search criteria.
- if self.product or self.sourcepackagename or self.project:
- # Will always be the same product, sourcepackage, or project.
+ if self.product or self.sourcepackagename or self.projectgroup:
+ # Will always be the same project, sourcepackage, or project group.
return ['owner']
elif self.distribution:
# Same distribution, sourcepackagename will vary.
@@ -1061,15 +1061,16 @@
status=QUESTION_STATUS_DEFAULT_SEARCH,
language=None, sort=None, owner=None,
needs_attention_from=None, unsupported_target=None,
- project=None, product=None, distribution=None,
+ projectgroup=None, product=None, distribution=None,
sourcepackagename=None):
- assert (product is not None or distribution is not None or
- project is not None), ("Missing a product, distribution or "
- "project context.")
+ assert (
+ product is not None or distribution is not None or
+ projectgroup is not None), (
+ "Missing a project, distribution or project group context.")
QuestionSearch.__init__(
self, search_text=search_text, status=status, language=language,
needs_attention_from=needs_attention_from, sort=sort,
- project=project, product=product,
+ projectgroup=projectgroup, product=product,
distribution=distribution, sourcepackagename=sourcepackagename)
if owner:
=== modified file 'lib/lp/registry/model/projectgroup.py'
--- lib/lp/registry/model/projectgroup.py 2014-09-09 09:57:28 +0000
+++ lib/lp/registry/model/projectgroup.py 2015-01-28 16:27:09 +0000
@@ -301,7 +301,7 @@
unsupported_target = None
return QuestionTargetSearch(
- project=self,
+ projectgroup=self,
search_text=search_text, status=status,
language=language, sort=sort, owner=owner,
needs_attention_from=needs_attention_from,
Follow ups