view decoupage/utils.py @ 95:c0f6a87d4dd8

paster still throws a fit about this but might as well enable it to do so
author Jeff Hammel <k0scist@gmail.com>
date Sun, 21 Aug 2016 19:39:18 -0700
parents cf18ea0313f9
children
line wrap: on
line source

def link(request, path):
  """return a permalink"""
  base_url = request.application_url.rstrip('/')
  if not path:
    return base_url + '/'
  if not isinstance(path, basestring):
    path = '/'.join(path)
  return '%s/%s' % (base_url, path.lstrip('/'))