#NEWLINE# def auto_apply( self , subject = None ) : #NEWLINE# #INDENT# 'Auto apply the action. subject is optional, and needs to be passed\n        in case of adding to m2m after create.\n        ' #NEWLINE# work_on = ( subject or self . subject ) #NEWLINE# actions = { #NEWLINE# #INDENT# SET : self . do_set , #NEWLINE# ADD : self . do_add , #NEWLINE# REMOVE : self . do_remove , #NEWLINE# CREATE : self . do_create , #NEWLINE# #UNINDENT# } #NEWLINE# doer = actions . get ( self . action ) #NEWLINE# return doer ( doer )