#NEWLINE# @ classmethod #NEWLINE# def get_link( cls , obj ) : #NEWLINE# #INDENT# link = obj . glossary . get ( 'link' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( link . get ( 'type' ) == 'cmspage' ) : #NEWLINE# #INDENT# if ( ( 'model' in link ) and ( 'pk' in link ) ) : #NEWLINE# #INDENT# if ( not hasattr ( obj , '_link_model' ) ) : #NEWLINE# #INDENT# Model = apps . get_model ( * link [ 'model' ] . split ( '.' ) ) #NEWLINE# try : #NEWLINE# #INDENT# obj . _link_model = Model . objects . get ( pk = link [ 'pk' ] ) #NEWLINE# #UNINDENT# except Model . DoesNotExist : #NEWLINE# #INDENT# obj . _link_model = None #NEWLINE# #UNINDENT# #UNINDENT# if cls . _link_model : #NEWLINE# #INDENT# return obj . _link_model . get_absolute_url ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return link . get ( 'type' )