Add an API to be able to construct urls
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: nexedi/erp5!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 nexedi/erp5@f601d7a5). So we said we should make an API to have an organised manner, like we have e.g. Base_redirect to handle redirects. - First commit adds this as a script in erp5_core, along with a test. - Second commit uses it. It is not on my scope to change all erp5 code, but I focused on changing on the things I already had to in nexedi/erp5@f601d7a5 @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 nexedi/erp5!333 rebased on this. But in any-way this should be separate from nexedi/erp5!333. /reviewed-on nexedi/erp5!431
Showing
Please register or sign in to comment