#NEWLINE# def sameas( self ) : #NEWLINE# #INDENT# if ( self . type == 'sameas' ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# kwargs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( check , value ) in parse_checks ( self . checks ) : #NEWLINE# #INDENT# if ( check == 'sameasid' ) : #NEWLINE# #INDENT# kwargs [ 'id' ] = value #NEWLINE# break #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( check == 'sameas' ) : #NEWLINE# #INDENT# kwargs [ 'number' ] = value #NEWLINE# kwargs [ 'questionset__questionnaire' ] = self . questionset . questionnaire #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . __sameas = res = getattr ( self , '__sameas' , Question . objects . get ( ** kwargs ) ) #NEWLINE# return res #NEWLINE# #UNINDENT# except Question . DoesNotExist : #NEWLINE# #INDENT# return Question ( type = 'comment' ) #NEWLINE# #UNINDENT# #UNINDENT# return self