#NEWLINE# def create_history_model( self , model ) : #NEWLINE# #INDENT# '\n        Creates a historical model to associate with the model provided.\n        ' #NEWLINE# attrs = { #NEWLINE# #INDENT# '__module__' : self . module , #NEWLINE# #UNINDENT# } #NEWLINE# app_module = ( '%s.models' % model . _meta . app_label ) #NEWLINE# if ( model . __module__ != self . module ) : #NEWLINE# #INDENT# attrs [ '__module__' ] = self . module #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( app_module != self . module ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# app = apps . app_configs [ model . _meta . app_label ] #NEWLINE# #UNINDENT# except NameError : #NEWLINE# #INDENT# models_module = get_app ( model . _meta . app_label ) . __name__ #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# models_module = app . name #NEWLINE# #UNINDENT# attrs [ '__module__' ] = models_module #NEWLINE# #UNINDENT# #UNINDENT# fields = self . copy_fields ( model ) #NEWLINE# attrs . update ( fields ) #NEWLINE# attrs . update ( self . get_extra_fields ( model , fields ) ) #NEWLINE# attrs . update ( Meta = type ( str ( 'Meta' ) , ( ) , self . get_meta_options ( model ) ) ) #NEWLINE# if ( self . table_name is not None ) : #NEWLINE# #INDENT# attrs [ 'Meta' ] . db_table = self . table_name #NEWLINE# #UNINDENT# name = ( 'Historical%s' % model . _meta . object_name ) #NEWLINE# registered_models [ model . _meta . db_table ] = model #NEWLINE# return python_2_unicode_compatible ( type ( str ( name ) , self . bases , attrs ) )