#NEWLINE# def update_or_create( self , **kwargs ) : #NEWLINE# #INDENT# ( obj , created ) = self . get_or_create ( ** kwargs ) #NEWLINE# if ( ( not created ) and ( 'defaults' in kwargs ) ) : #NEWLINE# #INDENT# for ( k , v ) in kwargs [ 'defaults' ] . iteritems ( ) : #NEWLINE# #INDENT# setattr ( obj , k , v ) #NEWLINE# #UNINDENT# obj . save ( ) #NEWLINE# #UNINDENT# return ( obj , created )