#NEWLINE# def _save_impl( self , state ) : #NEWLINE# #INDENT# if ( state . key is not None ) : #NEWLINE# #INDENT# raise sa_exc . InvalidRequestError ( ( "Object '%s' already has an identity - it can't be registered as pending" % state_str ( state ) ) ) #NEWLINE# #UNINDENT# self . _before_attach ( state ) #NEWLINE# if ( state not in self . _new ) : #NEWLINE# #INDENT# self . _new [ state ] = state . obj ( ) #NEWLINE# state . insert_order = len ( self . _new ) #NEWLINE# #UNINDENT# self . _attach ( state )