#NEWLINE# def _create_object_from_params( self , lookup , params ) : #NEWLINE# #INDENT# '\n        Tries to create an object using passed params.\n        Used by get_or_create and update_or_create\n        ' #NEWLINE# try : #NEWLINE# #INDENT# with transaction . atomic ( using = self . db ) : #NEWLINE# #INDENT# obj = self . create ( ** params ) #NEWLINE# #UNINDENT# return ( exc_info , True ) #NEWLINE# #UNINDENT# except IntegrityError : #NEWLINE# #INDENT# exc_info = sys . exc_info ( ) #NEWLINE# try : #NEWLINE# #INDENT# return ( self . get ( ** lookup ) , False ) #NEWLINE# #UNINDENT# except self . model . DoesNotExist : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# six . reraise ( * exc_info )