示例#1
0
文件: urls.py 项目: fwenzel/reporter
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)
示例#2
0
文件: urls.py 项目: tofumatt/reporter
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)
示例#3
0
	def _format_url(self, url, parent_id = None):
		return url.replace(
			'12345', '<b>&lt;id&gt;</b>'
		).replace(
			'67890', '<b>&lt;%s&gt;</b>' % parent_id
		).replace(
			'xml', '<b>&lt;format&gt;</b>'
		)
示例#4
0
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)