Add web_link property to resources
Bug #316694 reported by
Gavin Panella
This bug affects 5 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
Leonard Richardson | ||
lazr.restful |
Fix Released
|
High
|
Leonard Richardson |
Bug Description
It would be useful to be able to get the link to a human-readable
representation of an API object. The transformation is relatively
simple:
Leonard Richardson wrote:
> ... you can replace '/api/[^/]*/' with ''. We've determined that
> that's always the relationship between the web service canonical_url
> and the browser canonical_url.
It makes sense to add a method or property to API objects that does
just this.
Related branches
lp:~leonardr/launchpad/web-link
- Tim Penhey (community): Approve
-
Diff: 981 lines (+108/-61)37 files modifiedlib/canonical/launchpad/browser/librarian.py (+1/-3)
lib/canonical/launchpad/doc/canonical_url_examples.txt (+1/-1)
lib/canonical/launchpad/webapp/configure.zcml (+1/-1)
lib/canonical/launchpad/webapp/interfaces.py (+0/-8)
lib/lp/app/doc/tales.txt (+2/-2)
lib/lp/blueprints/tests/test_webservice.py (+2/-1)
lib/lp/bugs/browser/configure.zcml (+6/-3)
lib/lp/bugs/browser/tests/buglinktarget-views.txt (+2/-2)
lib/lp/bugs/interfaces/bugnomination.py (+1/-1)
lib/lp/bugs/interfaces/bugsubscription.py (+1/-1)
lib/lp/bugs/stories/webservice/xx-bug-tracker.txt (+2/-0)
lib/lp/bugs/stories/webservice/xx-bug.txt (+17/-2)
lib/lp/code/interfaces/diff.py (+1/-1)
lib/lp/code/stories/webservice/xx-branch.txt (+1/-1)
lib/lp/code/stories/webservice/xx-branchmergeproposal.txt (+5/-1)
lib/lp/code/stories/webservice/xx-branchsubscription.txt (+2/-0)
lib/lp/hardwaredb/interfaces/hwdb.py (+9/-9)
lib/lp/registry/interfaces/productrelease.py (+1/-1)
lib/lp/registry/interfaces/structuralsubscription.py (+1/-1)
lib/lp/registry/interfaces/wikiname.py (+1/-1)
lib/lp/registry/stories/webservice/xx-distribution-mirror.txt (+4/-0)
lib/lp/registry/stories/webservice/xx-distribution-source-package.txt (+2/-1)
lib/lp/registry/stories/webservice/xx-distribution.txt (+2/-0)
lib/lp/registry/stories/webservice/xx-distroseries.txt (+1/-1)
lib/lp/registry/stories/webservice/xx-person.txt (+5/-1)
lib/lp/registry/stories/webservice/xx-project-registry.txt (+14/-4)
lib/lp/services/worlddata/interfaces/country.py (+2/-1)
lib/lp/soyuz/interfaces/archivedependency.py (+1/-1)
lib/lp/soyuz/interfaces/archivepermission.py (+1/-1)
lib/lp/soyuz/interfaces/packageset.py (+3/-3)
lib/lp/soyuz/interfaces/publishing.py (+2/-2)
lib/lp/soyuz/interfaces/queue.py (+1/-1)
lib/lp/soyuz/stories/webservice/xx-archive.txt (+5/-0)
lib/lp/soyuz/stories/webservice/xx-builds.txt (+3/-1)
lib/lp/soyuz/stories/webservice/xx-distroarchseries.txt (+1/-1)
lib/lp/translations/stories/webservice/xx-potemplate.txt (+1/-0)
versions.cfg (+3/-3)
lp:~leonardr/lazr.restful/web-link
- Tim Penhey (community): Approve
-
Diff: 339 lines (+145/-34)6 files modifiedsrc/lazr/restful/_resource.py (+20/-13)
src/lazr/restful/docs/webservice.txt (+25/-10)
src/lazr/restful/publisher.py (+1/-1)
src/lazr/restful/tales.py (+4/-0)
src/lazr/restful/templates/wadl-root.pt (+7/-0)
src/lazr/restful/tests/test_webservice.py (+88/-10)
lp:~leonardr/launchpad/use-web-link
- Jeroen T. Vermeulen (community): Approve (code)
-
Diff: 40 lines (+7/-9)1 file modifiedlib/lp/app/javascript/picker.js (+7/-9)
Changed in launchpadlib: | |
importance: | Undecided → High |
status: | Confirmed → Triaged |
affects: | launchpadlib → lazr.restful |
Changed in lazr.restful: | |
status: | Triaged → In Progress |
assignee: | nobody → Leonard Richardson (leonardr) |
Changed in launchpad: | |
status: | New → In Progress |
importance: | Undecided → High |
assignee: | nobody → Leonard Richardson (leonardr) |
tags: | added: api |
tags: |
added: qa-ok removed: qa-needstesting |
Changed in lazr.restful: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
yes, having such a method for recources would be really cool, I'm using something similiar to replace( "api.", "").replace( "beta/" , "")
url = self_url.
very often.