#NEWLINE# @ util . dependencies ( 'sqlalchemy.orm.base' ) #NEWLINE# def __init__( self , base , obj , msg = None ) : #NEWLINE# #INDENT# if ( not msg ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# base . class_mapper ( type ( obj ) ) #NEWLINE# name = _safe_cls_name ( type ( obj ) ) #NEWLINE# msg = ( 'Class %r is mapped, but this instance lacks instrumentation.  This occurs when the instanceis created before sqlalchemy.orm.mapper(%s) was called.' % ( name , name ) ) #NEWLINE# #UNINDENT# except UnmappedClassError : #NEWLINE# #INDENT# msg = _default_unmapped ( type ( obj ) ) #NEWLINE# if isinstance ( obj , type ) : #NEWLINE# #INDENT# msg += ( '; was a class (%s) supplied where an instance was required?' % _safe_cls_name ( obj ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# UnmappedError . __init__ ( name , msg )