Merge lp:~james-w/launchpad/export-code-import into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Curtis Hovey | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | not available | ||||
Proposed branch: | lp:~james-w/launchpad/export-code-import | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
184 lines (+28/-16) 6 files modified
lib/canonical/launchpad/doc/webservice-marshallers.txt (+5/-3) lib/canonical/launchpad/interfaces/_schema_circular_imports.py (+4/-0) lib/lp/code/interfaces/codeimport.py (+6/-3) lib/lp/registry/interfaces/distroseries.py (+6/-5) lib/lp/registry/interfaces/productseries.py (+2/-1) lib/lp/registry/interfaces/projectgroup.py (+5/-4) |
||||
To merge this branch: | bzr merge lp:~james-w/launchpad/export-code-import | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Curtis Hovey (community) | Approve | ||
Review via email: mp+22175@code.launchpad.net |
Commit message
Various attributes are now exported correctly so that they can be used by launchpadlib.
Description of the change
Fix various exports to use ReferenceChoice.
When exporting something that is a link to another exported
object you must use a lazr.restful field, rather than a plain
zope one.
This is because lazr.restful has to know that it is a link to
an exported object so that it can have special behaviour.
Currently when you don't do this you don't get an error until
you come to access it with launchpadlib.
What happens is that the tales that writes out the wadl just
considers it to be a plain attribute, and so writes out
<wadl attribute name> == <field name>.
However, when the marshaller comes to write out the JSON for the
object that it will find there it sees that it is an exported
object and so writes out the URL instead. As it does this though
it gives it name of <field name> + "_link", which doesn't match
the wadl.
Therefore the webservice doesn't behave as stated and the client
falls over.
Thanks,
James
Hi James.
We talked IRC and agreed that this branch does fix the specific issues, but not the root cause. You are already working on a fix for the root cause that will not require us to rewrite the existing tests...which gave us a false sense that the wadl and json were in agreement.