#NEWLINE# def load_model_class( model_path ) : #NEWLINE# #INDENT# "\n    Load by import a class by a string path like:\n    'module.models.MyModel'.\n    This mechanism allows extension and customization of\n    the Entry model class.\n    " #NEWLINE# dot = model_path . rindex ( '.' ) #NEWLINE# module_name = model_path [ : dot ] #NEWLINE# class_name = module_name [ ( dot + 1 ) : ] #NEWLINE# try : #NEWLINE# #INDENT# _class = getattr ( import_module ( module_name ) , class_name ) #NEWLINE# return _class #NEWLINE# #UNINDENT# except ( ImportError , AttributeError ) : #NEWLINE# #INDENT# raise ImproperlyConfigured ( ( '%s cannot be imported' % model_path ) )