Merge lp:~abentley/launchpad/specification-cleanup into lp:launchpad

Proposed by Aaron Bentley on 2012-09-27
Status: Merged
Approved by: j.c.sackett on 2012-09-27
Approved revision: no longer in the source branch.
Merged at revision: 16057
Proposed branch: lp:~abentley/launchpad/specification-cleanup
Merge into: lp:launchpad
Prerequisite: lp:~abentley/launchpad/storm-sprint-queries
Diff against target: 749 lines (+85/-181)
25 files modified
lib/lp/_schema_circular_imports.py (+2/-2)
lib/lp/app/browser/root.py (+1/-1)
lib/lp/blueprints/browser/configure.zcml (+9/-3)
lib/lp/blueprints/browser/specification.py (+18/-1)
lib/lp/blueprints/browser/specificationtarget.py (+1/-1)
lib/lp/blueprints/doc/specification.txt (+1/-4)
lib/lp/blueprints/interfaces/specification.py (+2/-2)
lib/lp/blueprints/interfaces/specificationtarget.py (+6/-19)
lib/lp/blueprints/model/specification.py (+8/-19)
lib/lp/blueprints/model/sprint.py (+0/-9)
lib/lp/blueprints/templates/specifications-portlet-latestcompleted.pt (+1/-1)
lib/lp/blueprints/templates/specifications-portlet-latestregistered.pt (+1/-1)
lib/lp/blueprints/templates/specifications-portlet-stats.pt (+1/-1)
lib/lp/blueprints/tests/test_hasspecifications.py (+13/-13)
lib/lp/bugs/model/tests/test_bugtask.py (+1/-1)
lib/lp/registry/browser/__init__.py (+3/-2)
lib/lp/registry/doc/distribution.txt (+1/-1)
lib/lp/registry/doc/milestone.txt (+2/-2)
lib/lp/registry/doc/projectgroup.txt (+14/-14)
lib/lp/registry/model/distribution.py (+0/-10)
lib/lp/registry/model/distroseries.py (+0/-9)
lib/lp/registry/model/person.py (+0/-13)
lib/lp/registry/model/product.py (+0/-13)
lib/lp/registry/model/productseries.py (+0/-13)
lib/lp/registry/model/projectgroup.py (+0/-26)
To merge this branch: bzr merge lp:~abentley/launchpad/specification-cleanup
Reviewer Review Type Date Requested Status
j.c.sackett (community) 2012-09-27 Approve on 2012-09-27
Review via email: mp+126789@code.launchpad.net

Commit Message

Reorganize specification access methods.

Description of the Change

= Summary =
Reorginize specification list methods

== Pre-implementation notes ==
None

== LOC Rationale ==
Part of private projects

== Implementation details ==
Supporting privacy in specification listings requires taking a user as input when listing specs. Ideally, that means supplying the user in the view code.

This doesn't actually add privacy support, but it prepares the methods so that it can be implemented cleanly.

specification_count becomes a method so that it can start accepting a user as a parameter.

all_specifications and valid_specifications are part of the web service API, so they cannot be removed even though they can't accept a user parameter. They are renamed as private, with the old name retained in the API.

The implementation of latest_specifications, latest_completed_specifications and specification_count is moved to SpecificationSetView. The appropriate pages are updated to use SpecificationSetView.

== Tests ==
Everything, really.

== Demo and Q/A ==

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/blueprints/templates/specifications-portlet-latestregistered.pt
  lib/lp/blueprints/tests/test_hasspecifications.py
  lib/lp/services/database/stormexpr.py
  lib/lp/registry/doc/milestone.txt
  lib/lp/registry/model/projectgroup.py
  lib/lp/registry/doc/distribution.txt
  lib/lp/registry/model/productseries.py
  lib/lp/blueprints/interfaces/specificationtarget.py
  lib/lp/app/browser/root.py
  lib/lp/blueprints/templates/specificationtarget-assignments.pt
  lib/lp/blueprints/browser/specificationtarget.py
  lib/lp/blueprints/model/tests/test_sprint.py
  lib/lp/bugs/model/tests/test_bugtask.py
  lib/lp/blueprints/templates/specifications-portlet-stats.pt
  lib/lp/registry/doc/projectgroup.txt
  lib/lp/blueprints/model/specification.py
  lib/lp/registry/browser/__init__.py
  lib/lp/blueprints/model/sprint.py
  lib/lp/blueprints/templates/specifications-portlet-latestcompleted.pt
  lib/lp/testing/_webservice.py
  lib/lp/registry/model/product.py
  lib/lp/blueprints/browser/configure.zcml
  lib/lp/blueprints/browser/tests/test_sprint.py
  lib/lp/blueprints/doc/specification.txt
  lib/lp/blueprints/browser/specification.py
  lib/lp/registry/model/person.py
  lib/lp/registry/model/distroseries.py
  lib/lp/_schema_circular_imports.py
  lib/lp/registry/model/distribution.py
  lib/lp/blueprints/interfaces/specification.py

./lib/lp/registry/model/product.py
     408: redefinition of function 'date_next_suggest_packaging' from line 400

^^^ This is an acceptable case of re-definition. It's creating a setter.

To post a comment you must log in.
j.c.sackett (jcsackett) wrote :

This looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/_schema_circular_imports.py'
2--- lib/lp/_schema_circular_imports.py 2012-08-10 17:08:57 +0000
3+++ lib/lp/_schema_circular_imports.py 2012-09-27 20:14:26 +0000
4@@ -734,9 +734,9 @@
5
6 # IHasSpecifications
7 patch_collection_property(
8- IHasSpecifications, 'all_specifications', ISpecification)
9+ IHasSpecifications, '_all_specifications', ISpecification)
10 patch_collection_property(
11- IHasSpecifications, 'valid_specifications', ISpecification)
12+ IHasSpecifications, '_valid_specifications', ISpecification)
13
14
15 ###
16
17=== modified file 'lib/lp/app/browser/root.py'
18--- lib/lp/app/browser/root.py 2012-08-14 23:27:07 +0000
19+++ lib/lp/app/browser/root.py 2012-09-27 20:14:26 +0000
20@@ -130,7 +130,7 @@
21 @property
22 def blueprint_count(self):
23 """The total blueprint count in all of Launchpad."""
24- return getUtility(ISpecificationSet).specification_count
25+ return getUtility(ISpecificationSet).specificationCount()
26
27 @property
28 def answer_count(self):
29
30=== modified file 'lib/lp/blueprints/browser/configure.zcml'
31--- lib/lp/blueprints/browser/configure.zcml 2012-09-11 20:55:23 +0000
32+++ lib/lp/blueprints/browser/configure.zcml 2012-09-27 20:14:26 +0000
33@@ -488,15 +488,21 @@
34 permission="zope.Public">
35
36 <browser:page
37+ name="+portlet-sprints"
38+ template="../templates/specifications-portlet-sprints.pt"/>
39+ </browser:pages>
40+ <browser:pages
41+ for="lp.blueprints.interfaces.specification.ISpecificationSet"
42+ permission="zope.Public"
43+ class="lp.blueprints.browser.specification.SpecificationSetView">
44+
45+ <browser:page
46 name="+portlet-latestcompleted"
47 template="../templates/specifications-portlet-latestcompleted.pt"/>
48 <browser:page
49 name="+portlet-latestregistered"
50 template="../templates/specifications-portlet-latestregistered.pt"/>
51 <browser:page
52- name="+portlet-sprints"
53- template="../templates/specifications-portlet-sprints.pt"/>
54- <browser:page
55 name="+portlet-stats"
56 template="../templates/specifications-portlet-stats.pt"/>
57 </browser:pages>
58
59=== modified file 'lib/lp/blueprints/browser/specification.py'
60--- lib/lp/blueprints/browser/specification.py 2012-09-26 13:19:19 +0000
61+++ lib/lp/blueprints/browser/specification.py 2012-09-27 20:14:26 +0000
62@@ -1,4 +1,4 @@
63-# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
64+# Copyright 2009-2012 Canonical Ltd. This software is licensed under the
65 # GNU Affero General Public License version 3 (see the file LICENSE).
66
67 """Specification views."""
68@@ -112,7 +112,9 @@
69 from lp.blueprints.enums import (
70 NewSpecificationDefinitionStatus,
71 SpecificationDefinitionStatus,
72+ SpecificationFilter,
73 SpecificationImplementationStatus,
74+ SpecificationSort,
75 )
76 from lp.blueprints.errors import TargetAlreadyHasSpecification
77 from lp.blueprints.interfaces.specification import (
78@@ -1527,6 +1529,21 @@
79
80 label = 'Blueprints'
81
82+ @property
83+ def latest_specifications(self):
84+ return self.context.specifications(
85+ sort=SpecificationSort.DATE, quantity=5)
86+
87+ @property
88+ def latest_completed_specifications(self):
89+ return self.context.specifications(
90+ sort=SpecificationSort.DATE, quantity=5,
91+ filter=[SpecificationFilter.COMPLETE])
92+
93+ @property
94+ def specification_count(self):
95+ return self.context.specificationCount()
96+
97 @safe_action
98 @action('Find blueprints', name="search")
99 def search_action(self, action, data):
100
101=== modified file 'lib/lp/blueprints/browser/specificationtarget.py'
102--- lib/lp/blueprints/browser/specificationtarget.py 2012-07-05 00:47:31 +0000
103+++ lib/lp/blueprints/browser/specificationtarget.py 2012-09-27 20:14:26 +0000
104@@ -259,7 +259,7 @@
105
106 @cachedproperty
107 def has_any_specifications(self):
108- return self.context.has_any_specifications
109+ return self.context._all_specifications.count() != 0
110
111 @cachedproperty
112 def all_specifications(self):
113
114=== modified file 'lib/lp/blueprints/doc/specification.txt'
115--- lib/lp/blueprints/doc/specification.txt 2011-12-30 06:14:56 +0000
116+++ lib/lp/blueprints/doc/specification.txt 2012-09-27 20:14:26 +0000
117@@ -99,10 +99,7 @@
118
119 SpecificationSet implements the ISpecificationSet interface
120
121- >>> ubuspec in specset.all_specifications
122- True
123-
124- >>> specset.has_any_specifications
125+ >>> ubuspec in specset._all_specifications
126 True
127
128 >>> from lp.services.webapp.testing import verifyObject
129
130=== modified file 'lib/lp/blueprints/interfaces/specification.py'
131--- lib/lp/blueprints/interfaces/specification.py 2012-09-17 15:19:10 +0000
132+++ lib/lp/blueprints/interfaces/specification.py 2012-09-27 20:14:26 +0000
133@@ -674,8 +674,8 @@
134
135 coming_sprints = Attribute("The next 5 sprints in the system.")
136
137- specification_count = Attribute(
138- "The total number of blueprints in Launchpad")
139+ def specificationCount():
140+ """The total number of blueprints in Launchpad"""
141
142 def getStatusCountsForProductSeries(product_series):
143 """Return the status counts for blueprints in a series.
144
145=== modified file 'lib/lp/blueprints/interfaces/specificationtarget.py'
146--- lib/lp/blueprints/interfaces/specificationtarget.py 2012-09-13 11:31:12 +0000
147+++ lib/lp/blueprints/interfaces/specificationtarget.py 2012-09-27 20:14:26 +0000
148@@ -26,10 +26,7 @@
149 CollectionField,
150 Reference,
151 )
152-from zope.interface import (
153- Attribute,
154- Interface,
155- )
156+from zope.interface import Interface
157 from zope.schema import TextLine
158
159 from lp import _
160@@ -42,7 +39,7 @@
161 associated with them, and you can use this interface to query those.
162 """
163
164- all_specifications = exported(doNotSnapshot(
165+ _all_specifications = exported(doNotSnapshot(
166 CollectionField(
167 title=_("All specifications"),
168 value_type=Reference(schema=Interface), # ISpecification, really.
169@@ -50,13 +47,9 @@
170 description=_(
171 'A list of all specifications, regardless of status or '
172 'approval or completion, for this object.'))),
173- as_of="devel")
174-
175- has_any_specifications = Attribute(
176- 'A true or false indicator of whether or not this object has any '
177- 'specifications associated with it, regardless of their status.')
178-
179- valid_specifications = exported(doNotSnapshot(
180+ exported_as="all_specifications", as_of="devel")
181+
182+ _valid_specifications = exported(doNotSnapshot(
183 CollectionField(
184 title=_("Valid specifications"),
185 value_type=Reference(schema=Interface), # ISpecification, really.
186@@ -65,13 +58,7 @@
187 'All specifications that are not obsolete. When called from '
188 'an ISpecificationGoal it will also exclude the ones that '
189 'have not been accepted for that goal'))),
190- as_of="devel")
191-
192- latest_specifications = Attribute(
193- "The latest 5 specifications registered for this context.")
194-
195- latest_completed_specifications = Attribute(
196- "The 5 specifications most recently completed for this context.")
197+ exported_as="valid_specifications", as_of="devel")
198
199 def specifications(quantity=None, sort=None, filter=None,
200 prejoin_people=True):
201
202=== modified file 'lib/lp/blueprints/model/specification.py'
203--- lib/lp/blueprints/model/specification.py 2012-09-27 20:14:26 +0000
204+++ lib/lp/blueprints/model/specification.py 2012-09-27 20:14:26 +0000
205@@ -1022,23 +1022,16 @@
206 return DecoratedResultSet(results, pre_iter_hook=cache_people)
207
208 @property
209- def valid_specifications(self):
210+ def _all_specifications(self):
211+ """See IHasSpecifications."""
212+ return self.specifications(filter=[SpecificationFilter.ALL])
213+
214+ @property
215+ def _valid_specifications(self):
216 """See IHasSpecifications."""
217 return self.specifications(filter=[SpecificationFilter.VALID])
218
219- @property
220- def latest_specifications(self):
221- """See IHasSpecifications."""
222- return self.specifications(sort=SpecificationSort.DATE, quantity=5)
223-
224- @property
225- def latest_completed_specifications(self):
226- """See IHasSpecifications."""
227- return self.specifications(sort=SpecificationSort.DATE, quantity=5,
228- filter=[SpecificationFilter.COMPLETE, ])
229-
230- @property
231- def specification_count(self):
232+ def specificationCount(self):
233 """See IHasSpecifications."""
234 return self.specifications(filter=[SpecificationFilter.ALL]).count()
235
236@@ -1072,17 +1065,13 @@
237 return cur.fetchall()
238
239 @property
240- def all_specifications(self):
241+ def _all_specifications(self):
242 return Specification.select()
243
244 def __iter__(self):
245 """See ISpecificationSet."""
246 return iter(self.all_specifications)
247
248- @property
249- def has_any_specifications(self):
250- return self.all_specifications.count() != 0
251-
252 def specifications(self, sort=None, quantity=None, filter=None,
253 prejoin_people=True):
254 """See IHasSpecifications."""
255
256=== modified file 'lib/lp/blueprints/model/sprint.py'
257--- lib/lp/blueprints/model/sprint.py 2012-09-27 20:14:26 +0000
258+++ lib/lp/blueprints/model/sprint.py 2012-09-27 20:14:26 +0000
259@@ -169,15 +169,6 @@
260 query.append(fti_search(Specification, constraint))
261 return query
262
263- @property
264- def has_any_specifications(self):
265- """See IHasSpecifications."""
266- return self.all_specifications.count()
267-
268- @property
269- def all_specifications(self):
270- return self.specifications(filter=[SpecificationFilter.ALL])
271-
272 def specifications(self, sort=None, quantity=None, filter=None,
273 prejoin_people=False):
274 """See IHasSpecifications."""
275
276=== modified file 'lib/lp/blueprints/templates/specifications-portlet-latestcompleted.pt'
277--- lib/lp/blueprints/templates/specifications-portlet-latestcompleted.pt 2009-07-17 17:59:07 +0000
278+++ lib/lp/blueprints/templates/specifications-portlet-latestcompleted.pt 2012-09-27 20:14:26 +0000
279@@ -5,7 +5,7 @@
280 omit-tag="">
281
282 <h2>Recently completed</h2>
283-<table tal:define="speclist context/latest_completed_specifications">
284+<table tal:define="speclist view/latest_completed_specifications">
285 <tr tal:repeat="spec speclist"
286 tal:replace="structure spec/@@+listing-compact" />
287 </table>
288
289=== modified file 'lib/lp/blueprints/templates/specifications-portlet-latestregistered.pt'
290--- lib/lp/blueprints/templates/specifications-portlet-latestregistered.pt 2009-07-17 17:59:07 +0000
291+++ lib/lp/blueprints/templates/specifications-portlet-latestregistered.pt 2012-09-27 20:14:26 +0000
292@@ -5,7 +5,7 @@
293 omit-tag="">
294
295 <h2>Recently registered</h2>
296-<table tal:define="speclist context/latest_specifications">
297+<table tal:define="speclist view/latest_specifications">
298 <tbody>
299 <tr tal:repeat="spec speclist"
300 tal:replace="structure spec/@@+listing-compact" />
301
302=== modified file 'lib/lp/blueprints/templates/specifications-portlet-stats.pt'
303--- lib/lp/blueprints/templates/specifications-portlet-stats.pt 2009-07-17 17:59:07 +0000
304+++ lib/lp/blueprints/templates/specifications-portlet-stats.pt 2012-09-27 20:14:26 +0000
305@@ -5,7 +5,7 @@
306 omit-tag="">
307
308 <div>
309- <strong tal:content="context/specification_count">5</strong> blueprints
310+ <strong tal:content="view/specification_count">5</strong> blueprints
311 registered in Launchpad
312 </div>
313 </tal:root>
314
315=== modified file 'lib/lp/blueprints/tests/test_hasspecifications.py'
316--- lib/lp/blueprints/tests/test_hasspecifications.py 2012-01-01 02:58:52 +0000
317+++ lib/lp/blueprints/tests/test_hasspecifications.py 2012-09-27 20:14:26 +0000
318@@ -25,7 +25,7 @@
319 self.factory.makeSpecification(product=product, name="spec1")
320 self.factory.makeSpecification(product=product, name="spec2")
321 self.assertNamesOfSpecificationsAre(
322- ["spec1", "spec2"], product.all_specifications)
323+ ["spec1", "spec2"], product._all_specifications)
324
325 def test_product_valid_specifications(self):
326 product = self.factory.makeProduct()
327@@ -34,7 +34,7 @@
328 product=product, name="spec2",
329 status=SpecificationDefinitionStatus.OBSOLETE)
330 self.assertNamesOfSpecificationsAre(
331- ["spec1"], product.valid_specifications)
332+ ["spec1"], product._valid_specifications)
333
334 def test_distribution_all_specifications(self):
335 distribution = self.factory.makeDistribution()
336@@ -43,7 +43,7 @@
337 self.factory.makeSpecification(
338 distribution=distribution, name="spec2")
339 self.assertNamesOfSpecificationsAre(
340- ["spec1", "spec2"], distribution.all_specifications)
341+ ["spec1", "spec2"], distribution._all_specifications)
342
343 def test_distribution_valid_specifications(self):
344 distribution = self.factory.makeDistribution()
345@@ -53,7 +53,7 @@
346 distribution=distribution, name="spec2",
347 status=SpecificationDefinitionStatus.OBSOLETE)
348 self.assertNamesOfSpecificationsAre(
349- ["spec1"], distribution.valid_specifications)
350+ ["spec1"], distribution._valid_specifications)
351
352 def test_distroseries_all_specifications(self):
353 distroseries = self.factory.makeDistroSeries(name='maudlin')
354@@ -68,10 +68,10 @@
355 distribution=distribution, name="spec3")
356 self.assertNamesOfSpecificationsAre(
357 ["spec1", "spec2"],
358- distroseries.all_specifications)
359+ distroseries._all_specifications)
360
361 # XXX: salgado, 2010-11-25, bug=681432: Test disabled because
362- # DistroSeries.valid_specifications is broken.
363+ # DistroSeries._valid_specifications is broken.
364 def disabled_test_distroseries_valid_specifications(self):
365 distroseries = self.factory.makeDistroSeries(name='maudlin')
366 distribution = distroseries.distribution
367@@ -89,7 +89,7 @@
368 distribution=distribution, name="spec4")
369 self.assertNamesOfSpecificationsAre(
370 ["spec1", "spec2"],
371- distroseries.valid_specifications)
372+ distroseries._valid_specifications)
373
374 def test_productseries_all_specifications(self):
375 product = self.factory.makeProduct()
376@@ -101,7 +101,7 @@
377 product=product, name="spec2", goal=productseries)
378 self.factory.makeSpecification(product=product, name="spec3")
379 self.assertNamesOfSpecificationsAre(
380- ["spec1", "spec2"], productseries.all_specifications)
381+ ["spec1", "spec2"], productseries._all_specifications)
382
383 def test_productseries_valid_specifications(self):
384 product = self.factory.makeProduct()
385@@ -116,7 +116,7 @@
386 status=SpecificationDefinitionStatus.OBSOLETE)
387 self.factory.makeSpecification(product=product, name="spec4")
388 self.assertNamesOfSpecificationsAre(
389- ["spec1", "spec2"], productseries.valid_specifications)
390+ ["spec1", "spec2"], productseries._valid_specifications)
391
392 def test_projectgroup_all_specifications(self):
393 projectgroup = self.factory.makeProject()
394@@ -133,7 +133,7 @@
395 product=product3, name="spec3")
396 self.assertNamesOfSpecificationsAre(
397 ["spec1", "spec2"],
398- projectgroup.all_specifications)
399+ projectgroup._all_specifications)
400
401 def test_projectgroup_valid_specifications(self):
402 projectgroup = self.factory.makeProject()
403@@ -150,7 +150,7 @@
404 product=product3, name="spec3")
405 self.assertNamesOfSpecificationsAre(
406 ["spec1", "spec2"],
407- projectgroup.valid_specifications)
408+ projectgroup._valid_specifications)
409
410 def test_person_all_specifications(self):
411 person = self.factory.makePerson(name="james-w")
412@@ -163,7 +163,7 @@
413 self.factory.makeSpecification(
414 product=product, name="spec3")
415 self.assertNamesOfSpecificationsAre(
416- ["spec1", "spec2"], person.all_specifications)
417+ ["spec1", "spec2"], person._all_specifications)
418
419 def test_person_valid_specifications(self):
420 person = self.factory.makePerson(name="james-w")
421@@ -176,7 +176,7 @@
422 self.factory.makeSpecification(
423 product=product, name="spec3")
424 self.assertNamesOfSpecificationsAre(
425- ["spec1"], person.valid_specifications)
426+ ["spec1"], person._valid_specifications)
427
428
429 class HasSpecificationsSnapshotTestCase(TestCaseWithFactory):
430
431=== modified file 'lib/lp/bugs/model/tests/test_bugtask.py'
432--- lib/lp/bugs/model/tests/test_bugtask.py 2012-09-17 16:13:40 +0000
433+++ lib/lp/bugs/model/tests/test_bugtask.py 2012-09-27 20:14:26 +0000
434@@ -504,7 +504,7 @@
435 ' has_specification: False'])
436
437 # a specification gets linked...
438- spec = getUtility(ISpecificationSet).all_specifications[0]
439+ spec = getUtility(ISpecificationSet)._all_specifications[0]
440 spec.linkBug(bug_two)
441
442 # or a branch gets linked to the bug...
443
444=== modified file 'lib/lp/registry/browser/__init__.py'
445--- lib/lp/registry/browser/__init__.py 2012-09-24 05:17:00 +0000
446+++ lib/lp/registry/browser/__init__.py 2012-09-27 20:14:26 +0000
447@@ -165,14 +165,15 @@
448 params.setProductSeries(target)
449 else:
450 params = BugTaskSearchParams(
451- milestone=target, user=self.user, ignore_privacy=ignore_privacy)
452+ milestone=target, user=self.user,
453+ ignore_privacy=ignore_privacy)
454 bugtasks = getUtility(IBugTaskSet).search(params)
455 return list(bugtasks)
456
457 def _getSpecifications(self, target):
458 """Return the list `ISpecification`s associated to the target."""
459 if IProductSeries.providedBy(target):
460- return list(target.all_specifications)
461+ return list(target._all_specifications)
462 else:
463 return list(target.specifications)
464
465
466=== modified file 'lib/lp/registry/doc/distribution.txt'
467--- lib/lp/registry/doc/distribution.txt 2012-09-26 07:55:33 +0000
468+++ lib/lp/registry/doc/distribution.txt 2012-09-27 20:14:26 +0000
469@@ -562,7 +562,7 @@
470 ... spec.definition_status = (
471 ... SpecificationDefinitionStatus.SUPERSEDED)
472 ... shim = spec.updateLifecycleStatus(owner)
473- >>> for spec in kubuntu.valid_specifications:
474+ >>> for spec in kubuntu._valid_specifications:
475 ... print spec.name
476 kde-desktopfile-langpacks
477
478
479=== modified file 'lib/lp/registry/doc/milestone.txt'
480--- lib/lp/registry/doc/milestone.txt 2012-08-08 07:22:51 +0000
481+++ lib/lp/registry/doc/milestone.txt 2012-09-27 20:14:26 +0000
482@@ -289,7 +289,7 @@
483 the Gnome project has yet any specifications.
484
485 >>> for product in gnome.products:
486- ... print product.name, list(product.all_specifications)
487+ ... print product.name, list(product._all_specifications)
488 evolution []
489 gnome-terminal []
490 applets []
491@@ -303,7 +303,7 @@
492 milestone, it is "inheritied" by the project milestone.
493
494 >>> spec = test_helper.createSpecification('1.1', 'applets')
495- >>> [spec.name for spec in applets.all_specifications]
496+ >>> [spec.name for spec in applets._all_specifications]
497 [u'applets-specification']
498
499 >>> [spec.name for spec in gnome.getMilestone('1.1').specifications]
500
501=== modified file 'lib/lp/registry/doc/projectgroup.txt'
502--- lib/lp/registry/doc/projectgroup.txt 2011-12-30 06:14:56 +0000
503+++ lib/lp/registry/doc/projectgroup.txt 2012-09-27 20:14:26 +0000
504@@ -198,10 +198,10 @@
505 >>> firefox.active = True
506 >>> flush_database_updates()
507
508-We can get all the specifications via the all_specifications property,
509-and all valid specifications via the valid_specifications property:
510+We can get all the specifications via the _all_specifications property,
511+and all valid specifications via the _valid_specifications property:
512
513- >>> for spec in mozilla.all_specifications:
514+ >>> for spec in mozilla._all_specifications:
515 ... print spec.name
516 svg-support
517 canvas
518@@ -209,7 +209,7 @@
519 mergewin
520 e4x
521
522- >>> for spec in mozilla.valid_specifications:
523+ >>> for spec in mozilla._valid_specifications:
524 ... print spec.name
525 svg-support
526 canvas
527@@ -236,29 +236,29 @@
528 >>> print mozilla.getSeries('nonsense')
529 None
530
531-IProjectGroupSeries.all_specifications lists all specifications
532+IProjectGroupSeries._all_specifications lists all specifications
533 assigned to a series. Currently, no specifications are assigned to the
534 Mozilla series 1.0.
535
536- >>> specs = mozilla_series_1_0.all_specifications
537+ >>> specs = mozilla_series_1_0._all_specifications
538 >>> specs.count()
539 0
540
541 If a specification is assigned to series 1.0, it appears in
542-mozilla_1_0_series.all_specifications.
543+mozilla_1_0_series._all_specifications.
544
545 >>> filter = [SpecificationFilter.INFORMATIONAL]
546 >>> extension_manager_upgrades = mozilla.specifications(filter=filter)[0]
547 >>> series_1_0 = firefox.getSeries('1.0')
548 >>> extension_manager_upgrades.proposeGoal(series_1_0, no_priv)
549- >>> for spec in mozilla_series_1_0.all_specifications:
550+ >>> for spec in mozilla_series_1_0._all_specifications:
551 ... print spec.name
552 extension-manager-upgrades
553
554 This specification is not listed for other series.
555
556 >>> mozilla_trunk = mozilla.getSeries('trunk')
557- >>> print mozilla_trunk.all_specifications.count()
558+ >>> print mozilla_trunk._all_specifications.count()
559 0
560
561 Filtered lists of project series related specifications are generated
562@@ -270,7 +270,7 @@
563
564 If all existing specifications are assigned to the 1.0 series,...
565
566- >>> for spec in mozilla.all_specifications:
567+ >>> for spec in mozilla._all_specifications:
568 ... spec.proposeGoal(series_1_0, no_priv)
569
570 we have the save five incomplete specs in the series 1.0 as we have for the
571@@ -308,10 +308,10 @@
572
573 >>> firefox.active = True
574
575-We can get all the specifications via the all_specifications property,
576-and all valid specifications via the valid_specifications property:
577+We can get all the specifications via the _all_specifications property,
578+and all valid specifications via the _valid_specifications property:
579
580- >>> for spec in mozilla_series_1_0.all_specifications:
581+ >>> for spec in mozilla_series_1_0._all_specifications:
582 ... print spec.name
583 svg-support
584 canvas
585@@ -319,7 +319,7 @@
586 mergewin
587 e4x
588
589- >>> for spec in mozilla_series_1_0.valid_specifications:
590+ >>> for spec in mozilla_series_1_0._valid_specifications:
591 ... print spec.name
592 svg-support
593 canvas
594
595=== modified file 'lib/lp/registry/model/distribution.py'
596--- lib/lp/registry/model/distribution.py 2012-09-26 07:45:31 +0000
597+++ lib/lp/registry/model/distribution.py 2012-09-27 20:14:26 +0000
598@@ -878,16 +878,6 @@
599 return getUtility(IDistributionSet).getCurrentSourceReleases(
600 {self: source_package_names})
601
602- @property
603- def has_any_specifications(self):
604- """See `IHasSpecifications`."""
605- return self.all_specifications.count()
606-
607- @property
608- def all_specifications(self):
609- """See `IHasSpecifications`."""
610- return self.specifications(filter=[SpecificationFilter.ALL])
611-
612 def specifications(self, sort=None, quantity=None, filter=None,
613 prejoin_people=True):
614 """See `IHasSpecifications`.
615
616=== modified file 'lib/lp/registry/model/distroseries.py'
617--- lib/lp/registry/model/distroseries.py 2012-09-26 08:49:53 +0000
618+++ lib/lp/registry/model/distroseries.py 2012-09-27 20:14:26 +0000
619@@ -777,15 +777,6 @@
620 """See `IHasBugs`."""
621 return self.distribution.official_bug_tags
622
623- @property
624- def has_any_specifications(self):
625- """See IHasSpecifications."""
626- return self.all_specifications.count()
627-
628- @property
629- def all_specifications(self):
630- return self.specifications(filter=[SpecificationFilter.ALL])
631-
632 def specifications(self, sort=None, quantity=None, filter=None,
633 prejoin_people=True):
634 """See IHasSpecifications.
635
636=== modified file 'lib/lp/registry/model/person.py'
637--- lib/lp/registry/model/person.py 2012-09-27 02:52:48 +0000
638+++ lib/lp/registry/model/person.py 2012-09-27 20:14:26 +0000
639@@ -821,19 +821,6 @@
640 """See `IPerson`."""
641 return "%s (%s)" % (self.displayname, self.name)
642
643- @property
644- def has_any_specifications(self):
645- """See `IHasSpecifications`."""
646- return self.all_specifications.count()
647-
648- @property
649- def all_specifications(self):
650- return self.specifications(filter=[SpecificationFilter.ALL])
651-
652- @property
653- def valid_specifications(self):
654- return self.specifications(filter=[SpecificationFilter.VALID])
655-
656 def specifications(self, sort=None, quantity=None, filter=None,
657 prejoin_people=True):
658 """See `IHasSpecifications`."""
659
660=== modified file 'lib/lp/registry/model/product.py'
661--- lib/lp/registry/model/product.py 2012-09-25 16:52:09 +0000
662+++ lib/lp/registry/model/product.py 2012-09-27 20:14:26 +0000
663@@ -1303,19 +1303,6 @@
664 # automatically shared.
665 return True
666
667- @property
668- def has_any_specifications(self):
669- """See `IHasSpecifications`."""
670- return self.all_specifications.count()
671-
672- @property
673- def all_specifications(self):
674- return self.specifications(filter=[SpecificationFilter.ALL])
675-
676- @property
677- def valid_specifications(self):
678- return self.specifications(filter=[SpecificationFilter.VALID])
679-
680 def specifications(self, sort=None, quantity=None, filter=None,
681 prejoin_people=True):
682 """See `IHasSpecifications`."""
683
684=== modified file 'lib/lp/registry/model/productseries.py'
685--- lib/lp/registry/model/productseries.py 2012-09-07 19:40:53 +0000
686+++ lib/lp/registry/model/productseries.py 2012-09-27 20:14:26 +0000
687@@ -297,19 +297,6 @@
688 return ret
689
690 @property
691- def has_any_specifications(self):
692- """See IHasSpecifications."""
693- return self.all_specifications.count()
694-
695- @property
696- def all_specifications(self):
697- return self.specifications(filter=[SpecificationFilter.ALL])
698-
699- @property
700- def valid_specifications(self):
701- return self.specifications(filter=[SpecificationFilter.VALID])
702-
703- @property
704 def is_development_focus(self):
705 """See `IProductSeries`."""
706 return self == self.product.development_focus
707
708=== modified file 'lib/lp/registry/model/projectgroup.py'
709--- lib/lp/registry/model/projectgroup.py 2012-09-10 17:26:25 +0000
710+++ lib/lp/registry/model/projectgroup.py 2012-09-27 20:14:26 +0000
711@@ -231,19 +231,6 @@
712 """ % sqlvalues(self, SprintSpecificationStatus.ACCEPTED)
713 return query, ['Product', 'Specification', 'SprintSpecification']
714
715- @property
716- def has_any_specifications(self):
717- """See `IHasSpecifications`."""
718- return self.all_specifications.count()
719-
720- @property
721- def all_specifications(self):
722- return self.specifications(filter=[SpecificationFilter.ALL])
723-
724- @property
725- def valid_specifications(self):
726- return self.specifications(filter=[SpecificationFilter.VALID])
727-
728 def specifications(self, sort=None, quantity=None, filter=None,
729 series=None, prejoin_people=True):
730 """See `IHasSpecifications`."""
731@@ -650,19 +637,6 @@
732 sort, quantity, filter, self.name, prejoin_people=prejoin_people)
733
734 @property
735- def has_any_specifications(self):
736- """See `IHasSpecifications`."""
737- return self.all_specifications.count()
738-
739- @property
740- def all_specifications(self):
741- return self.specifications(filter=[SpecificationFilter.ALL])
742-
743- @property
744- def valid_specifications(self):
745- return self.specifications(filter=[SpecificationFilter.VALID])
746-
747- @property
748 def title(self):
749 return "%s Series %s" % (self.project.title, self.name)
750