Added links to .json and .jsono representations

Closes #62
This commit is contained in:
Simon Willison 2017-11-11 14:40:44 -08:00
commit 2366a016f2
5 changed files with 32 additions and 3 deletions

View file

@ -110,6 +110,14 @@ def path_with_added_args(request, args):
return request.path + '?' + urllib.parse.urlencode(current)
def path_with_ext(request, ext):
path = request.path
path += ext
if request.query_string:
path += '?' + request.query_string
return path
_css_re = re.compile(r'''['"\n\\]''')