#NEWLINE# def db_add_object( self , object , parentObjType = None , parentObjId = None ) : #NEWLINE# #INDENT# if ( ( parentObjType is None ) or ( parentObjId is None ) ) : #NEWLINE# #INDENT# parentObj = self #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# parentObj = self . objects [ ( parentObjType , parentObjId ) ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# msg = ( "Cannot find object of type '%s' with id '%s'" % ( parentObjType , parentObjId ) ) #NEWLINE# raise Exception ( msg ) #NEWLINE# #UNINDENT# #UNINDENT# funname = ( 'db_add_%s' % object . vtType ) #NEWLINE# objCopy = copy . copy ( object ) #NEWLINE# getattr ( parentObj , funname ) ( objCopy ) #NEWLINE# self . addToIndex ( objCopy )