def unchannel(request): url = request.META['PATH_INFO'] url = url.replace('beta/', '', 1).replace('release/', '', 1) qs = request.META['QUERY_STRING'] if qs: url += '?' + qs return redirect(url, permanent=True)
def _format_url(self, url, parent_id = None): return url.replace( '12345', '<b><id></b>' ).replace( '67890', '<b><%s></b>' % parent_id ).replace( 'xml', '<b><format></b>' )
def replace_partial_url(url, replace_from, replace_to): """ Simple helper at this point. Maybe useful if we want to try supporting regex in the future. """ return url.replace(replace_from, replace_to)