Conversation
|
regarding your question about absolute uri, my feeling was that by default we will skip domain from api, but I don't remember exactly what we said over the meeting about EDITED: So to test urls in unittests did you try using |
|
THAT IS AN EXAMPLE OF BUILDING ABSOLUTE URI in UNITTEST to assert values To call |
|
Is the absolute URI based on the |
|
@manics Are you talking about the Django test framework or 'real world'? I think it's Yes either way. |
|
@manics yes it is. My understanding was that we will omit using |
|
@will-moore The real world. We had a load of problems with the IDR due to multi-layered proxies, so just wanted to be sure this would work. |
|
Failing test test_dataset_images due to Need to handle this as in test_api_projects.py |
| Subclasses can configure self.urls to specify urls to add. | ||
| See ProjectsView urls as example | ||
| """ | ||
| # if self.urls is None: |
|
|
||
| # Urls to add to marshalled object. See ProjectsView for more details | ||
| urls = { | ||
| 'dataset_url': {'name': 'api_dataset', |
There was a problem hiding this comment.
maybe keep the same order for the url list in each view
i.e. retrieval of children then object e.g. datasets/project
There was a problem hiding this comment.
in Python order in dict is not guaranteed (unless you use https://docs.python.org/2.7/library/collections.html#collections.OrderedDict), why order matters?
There was a problem hiding this comment.
I found it easier to read when reviewing the code
This is mainly for review later on when we get back to it
|
As discussed in today's web meeting, we'll use the |
| """Build an absolute url using client response url.""" | ||
| response = client.request() | ||
| # http://testserver/webclient/ | ||
| webclint_url = response.url |
There was a problem hiding this comment.
typo: I think you mean webclient_url
|
@jburel fixed typo, thanks |
|
@will-moore I guess your comment is for #5023 |
|
Thanks @will-moore. Merging |
What this PR does
Adds urls to the api json in the same style as github api, E.g. https://api.github.com/users/will-moore
E,g, when listing
/projects/each will have links that are absolute urls (clickable in browser)Testing this PR
test_pdi_urls()and S>P intest_spw_urls()NB: urls can be configured to be "absolute" vv prefixed using the "omero.web.api.absolute_url" setting.
cc @chris-allan @aleksandra-tarkowska @jburel