#NEWLINE# def get_template_names( self ) : #NEWLINE# #INDENT# '\n        Return a list of template names to be used for the request. May not be\n        called if render_to_response is overridden. Returns the following list:\n\n        * the value of ``template_name`` on the view (if provided)\n        * the contents of the ``template_name_field`` field on the\n          object instance that the view is operating upon (if available)\n        * ``<app_label>/<model_name><template_name_suffix>.html``\n        ' #NEWLINE# try : #NEWLINE# #INDENT# names = super ( SingleObjectTemplateResponseMixin , self ) . get_template_names ( ) #NEWLINE# #UNINDENT# except ImproperlyConfigured : #NEWLINE# #INDENT# names = [ ] #NEWLINE# if ( self . object and self . template_name_field ) : #NEWLINE# #INDENT# name = getattr ( self . object , self . template_name_field , None ) #NEWLINE# if name : #NEWLINE# #INDENT# names . insert ( 0 , name ) #NEWLINE# #UNINDENT# #UNINDENT# if isinstance ( self . object , models . Model ) : #NEWLINE# #INDENT# names . append ( ( '%s/%s%s.html' % ( self . object . _meta . app_label , self . object . _meta . model_name , self . template_name_suffix ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( hasattr ( self , 'model' ) and ( self . model is not None ) and issubclass ( self . model , models . Model ) ) : #NEWLINE# #INDENT# names . append ( ( '%s/%s%s.html' % ( self . model . _meta . app_label , self . model . _meta . model_name , self . template_name_suffix ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( not names ) : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# #UNINDENT# return names