#NEWLINE# def get_model( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# model = self . args [ 0 ] #NEWLINE# #UNINDENT# except IndexError : #NEWLINE# #INDENT# raise CommandError ( 'Please supply at least one partitioned model' ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# ( module_name , model_name ) = model . rsplit ( '.' , 1 ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# raise CommandError ( 'Bad model name {}' . format ( model ) ) #NEWLINE# #UNINDENT# module = importlib . import_module ( module_name ) #NEWLINE# try : #NEWLINE# #INDENT# m = getattr ( module , model_name ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# raise CommandError ( 'Unknown model {}' . format ( model ) ) #NEWLINE# #UNINDENT# return m