Merge lp:~jcsackett/launchpad/api-wants-questionset into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | j.c.sackett | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 12857 | ||||
Proposed branch: | lp:~jcsackett/launchpad/api-wants-questionset | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
161 lines (+46/-10) 5 files modified
lib/lp/answers/browser/question.py (+1/-1) lib/lp/answers/interfaces/question.py (+2/-6) lib/lp/answers/interfaces/questioncollection.py (+24/-3) lib/lp/answers/interfaces/webservice.py (+9/-0) lib/lp/answers/tests/test_question_webservice.py (+10/-0) |
||||
To merge this branch: | bzr merge lp:~jcsackett/launchpad/api-wants-questionset | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Curtis Hovey (community) | code | Approve | |
Review via email: mp+57723@code.launchpad.net |
This proposal supersedes a proposal from 2011-04-08.
Commit message
[r=sinzui][bug=761877] Adds questionset toplevel to launchpad API.
Description of the change
Summary
=======
This exposes question set on the api, so https:/
This is a resubmit of a previous MP, specifically to address problems that were revealed when attempting to land this branch.
Preimp
======
Spoke with Curtis Hovey about exposing the top level elements of an application.
Implementation
==============
lib/lp/
-------
Change the traverse method for the questionset. It previously returned a redirect to the canonical_url of the question directly, and was request unaware, so it would redirect outside of api. Since canonical_url is called on returned objects higher up the stack (and *is* request aware), we can just rely on that.
lib/lp/
lib/lp/
-------
Exposed the needed elements of the QuestionSet interface on the API.
Some patching to deal with circular imports.
lib/lp/
-------
Exported IQuestion to all versions of the API, so the entry_schema is available for IQuestionSet (which cannot be restricted to a particular API version).
Tests
=====
bin/test -m lp.answers
bin/test -t test_wadl
QA
==
Since this changes traversal for questions, first make sure a the usual question links are working (e.g. /questions/
Then, attempt to load a question via the api over https:/
Lint
====
make lint output:
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
./lib/lp/
94: E302 expected 2 blank lines, found 0
./lib/lp/
18: 'IQuestionSet' imported but unused
17: 'IQuestion' imported but unused
The two unused imports are needed for the webservice zcml.
This looks good.
I tried to find a way to silence the "imported but unused" lint, but couldn't find a good way to do it.