#NEWLINE# def make_url( self , url , base_url = None , absolute = None , external = None ) : #NEWLINE# #INDENT# 'Helper method that creates a finalized URL based on the parameters\n        provided and the config.\n        ' #NEWLINE# url_style = self . db . config . url_style #NEWLINE# if ( absolute is None ) : #NEWLINE# #INDENT# absolute = ( url_style == 'absolute' ) #NEWLINE# #UNINDENT# if ( external is None ) : #NEWLINE# #INDENT# external = ( url_style == 'external' ) #NEWLINE# #UNINDENT# if external : #NEWLINE# #INDENT# external_base_url = self . db . config . base_url #NEWLINE# if ( external_base_url is None ) : #NEWLINE# #INDENT# raise RuntimeError ( 'To use absolute URLs you need to configure the URL in the project config.' ) #NEWLINE# #UNINDENT# return url_join ( base_url , url . lstrip ( '/' ) ) #NEWLINE# #UNINDENT# if absolute : #NEWLINE# #INDENT# return url_join ( self . db . config . base_path , url . lstrip ( '/' ) ) #NEWLINE# #UNINDENT# if ( base_url is None ) : #NEWLINE# #INDENT# raise RuntimeError ( 'Cannot calculate a relative URL if no base URL has been provided.' ) #NEWLINE# #UNINDENT# return make_relative_url ( base_url , url )