<s> from django . contrib import messages <EOL> class SuccessMessageMixin ( object ) : <EOL> """<STR_LIT>""" <EOL> success_message = '<STR_LIT>' <EOL> def form_valid ( self , form ) : <EOL> response = super ( SuccessMessageMixin , self ) . form_valid ( form ) <EOL> success_message = self . get_success_message ( form . cleaned_data ) <EOL> if success_message : <EOL> messages . success ( self . request , success_message ) <EOL> return response <EOL> def get_success_message ( self , cleaned_data ) : <EOL> return self . success_message % cleaned_data </s>
