Merge lp:~jcsackett/launchpad/restore-date_next_suggest_packaging into lp:launchpad

Proposed by j.c.sackett on 2012-09-25
Status: Merged
Approved by: Curtis Hovey on 2012-09-25
Approved revision: no longer in the source branch.
Merged at revision: 16030
Proposed branch: lp:~jcsackett/launchpad/restore-date_next_suggest_packaging
Merge into: lp:launchpad
Diff against target: 56 lines (+24/-0)
3 files modified
lib/lp/registry/interfaces/product.py (+7/-0)
lib/lp/registry/model/product.py (+16/-0)
lib/lp/registry/stories/webservice/xx-project-registry.txt (+1/-0)
To merge this branch: bzr merge lp:~jcsackett/launchpad/restore-date_next_suggest_packaging
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code 2012-09-25 Approve on 2012-09-25
Review via email: mp+126293@code.launchpad.net

Commit Message

Restore date_next_suggest_packaging as setter/getter rather than dbcolumn for API compatability.

Description of the Change

Summary
=======
Adds the date_next_suggest_packaging attribute back for API compatability.
It does not restore the db column.

Preimp
======
Spoke with Curtis Hovey.

Implementation
==============
An empty setter/getter pair is added so calls to the attribute return its
old default, None, and it cannot be changed. Description is updated to make it
clear that it is an obsolete attribute.

Tests
=====
bin/test -vvct xx-project-registry

QA
==
Ensure the attribute is available on 1.0 of the API.

LoC
===
This is part of a series with an LoC credit of 400+.

Lint
====

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/registry/interfaces/product.py
  lib/lp/registry/stories/webservice/xx-project-registry.txt
  lib/lp/registry/model/product.py

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

Our linter doesn't understand current python property declarations.

To post a comment you must log in.
Curtis Hovey (sinzui) wrote :

Thank you.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/interfaces/product.py'
2--- lib/lp/registry/interfaces/product.py 2012-09-25 15:03:30 +0000
3+++ lib/lp/registry/interfaces/product.py 2012-09-25 17:00:32 +0000
4@@ -675,6 +675,13 @@
5
6 sourcepackages = Attribute(_("List of packages for this product"))
7
8+ date_next_suggest_packaging = exported(
9+ Datetime(
10+ title=_('Next suggest packaging date'),
11+ description=_(
12+ "Obsolete. The date to resume Ubuntu package suggestions."),
13+ required=False))
14+
15 distrosourcepackages = Attribute(_("List of distribution packages for "
16 "this product"))
17
18
19=== modified file 'lib/lp/registry/model/product.py'
20--- lib/lp/registry/model/product.py 2012-09-25 15:03:30 +0000
21+++ lib/lp/registry/model/product.py 2012-09-25 17:00:32 +0000
22@@ -398,6 +398,22 @@
23 name='remote_product', allow_none=True, default=None)
24
25 @property
26+ def date_next_suggest_packaging(self):
27+ """See `IProduct`
28+
29+ Returns None; exists only to maintain API compatability.
30+ """
31+ return None
32+
33+ @date_next_suggest_packaging.setter
34+ def date_next_suggest_packaging(self, value):
35+ """See `IProduct`
36+
37+ Ignores supplied value; exists only to maintain API compatability.
38+ """
39+ pass
40+
41+ @property
42 def information_type(self):
43 """See `IProduct`
44
45
46=== modified file 'lib/lp/registry/stories/webservice/xx-project-registry.txt'
47--- lib/lp/registry/stories/webservice/xx-project-registry.txt 2012-09-25 16:30:05 +0000
48+++ lib/lp/registry/stories/webservice/xx-project-registry.txt 2012-09-25 17:00:32 +0000
49@@ -159,6 +159,7 @@
50 commercial_subscription_is_due: False
51 commercial_subscription_link: None
52 date_created: u'2004-09-24T20:58:02.185708+00:00'
53+ date_next_suggest_packaging: None
54 description: u'The Mozilla Firefox web browser'
55 development_focus_link: u'http://.../firefox/trunk'
56 display_name: u'Mozilla Firefox'