Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Use URLObject for URL manipulation throughout. #112
As of #111 we now use URLObject for URL Manipulation.
There's at least two other places we ought to now be using it:
Needs a quick look though the source to check if there's anywhere else that we should be doing the same.
Two thoughts: (1) this is so simple, I'm not sure URLObject would gain you much here, to be honest. Maybe some unicode safety, but I can't see any immediate potential problems (2) I assume this nasty thread-level monkey-patching is needed to handle cases where reverse is being called somewhere where a request is not available? If so, perhaps some sort of post-processing on URLs to convert relative to absolute could be done? It feels like misusing
Is there any test coverage for this? Randomly changing stuff in here doesn't seem to make any tests fail :( I'm guessing I should be writing tests before making the changes... any pointers?
Re: use of Spurl: can you see the requirement for this sort of URL manipulation inside templates increasing in the future? If not, introducing another dependency might be overkill. Maybe better to just replace the guts of
Yup that'd be nicer.
It's there because originally I needed (or thought I needed) as ay to force
It's grungy and needs to disappear, but just needs a bit of care to make sure that doing so isn't going to massively break existing code that's out there.
There's no tests for DocumentingTemplateRenderer at the moment. There should be.