#NEWLINE# @ view_config ( route_name = 'shortened' ) #NEWLINE# def short_ref_resolver( request ) : #NEWLINE# #INDENT# url_handler = Url ( request , short_url = request . matchdict [ 'short_ref' ] ) #NEWLINE# try : #NEWLINE# #INDENT# plain_url = url_handler . resolve ( ) #NEWLINE# #UNINDENT# except NotExists : #NEWLINE# #INDENT# raise httpexceptions . HTTPNotFound ( ) #NEWLINE# #UNINDENT# raise httpexceptions . HTTPMovedPermanently ( plain_url )