Skip to content

Add an API to be able to construct urls

[ this was merged, but later reverted by https://lab.nexedi.com/nexedi/erp5/commit/f236d898f32afb7a827253e437543b98bb63d720 because of a regression ]

This merge request is trying to provide an API so that we can construct urls in a more organised manner than manipulating strings.

The motivation, started from this merge request: https://lab.nexedi.com/nexedi/erp5/merge_requests/333, where absolute_url is overriden for Web Section and Web Site. Then we found that we have to do many dirty changes like:

              absolute_url python: here.absolute_url();
              absolute_url python: absolute_url[:-1] if absolute_url.endswith('/') else absolute_url;

(more of those in https://lab.nexedi.com/nexedi/erp5/commit/f601d7a5a5b1ea476c0da7f498608aec9e9aa723).

So we said we should make an API to have an organised manner, like we have e.g. Base_redirect to handle redirects.

@romain , @kazuhiko please make comments. Tests passed, but not on the final revision (did some amendments) and I think better not to re-run suite before getting comments. Also, @tatuya , I think you are responsible for ERP5 interfaces, so I would like your opinion if erp5_core is the good place, or maybe some other BT or product.

My plan would be to merge this and then https://lab.nexedi.com/nexedi/erp5/merge_requests/333 rebased on this. But in any-way this should be separate from https://lab.nexedi.com/nexedi/erp5/merge_requests/333.

Merge request reports