'Determines the HttpResponse for the change_view stage.'

def response_change(self, request, obj):

    opts = self.model._meta
    pk_value = obj._get_pk_val()
    preserved_filters = self.get_preserved_filters(request)
    msg_dict = {'name': force_text(opts.verbose_name), 'obj': force_text(obj)}
    if ('_continue' in request.POST):
        msg = (_('The    %(name)s    "%(obj)s"    was    changed    successfully.    You    may    edit    it    again    below.') % msg_dict)
        self.message_user(request, msg, messages.SUCCESS)
        redirect_url = request.path
        redirect_url = add_preserved_filters({'preserved_filters': preserved_filters, 'opts': opts}, redirect_url)
        return HttpResponseRedirect(redirect_url)
    elif ('_saveasnew' in request.POST):
        msg = (_('The    %(name)s    "%(obj)s"    was    added    successfully.    You    may    edit    it    again    below.') % msg_dict)
        self.message_user(request, msg, messages.SUCCESS)
        redirect_url = reverse(('admin:%s_%s_change' % (opts.app_label, opts.model_name)), args=(pk_value,), current_app=self.admin_site.name)
        redirect_url = add_preserved_filters({'preserved_filters': preserved_filters, 'opts': opts}, redirect_url)
        return HttpResponseRedirect(redirect_url)
    elif ('_addanother' in request.POST):
        msg = (_('The    %(name)s    "%(obj)s"    was    changed    successfully.    You    may    add    another    %(name)s    below.') % msg_dict)
        self.message_user(request, msg, messages.SUCCESS)
        redirect_url = reverse(('admin:%s_%s_add' % (opts.app_label, opts.model_name)), current_app=self.admin_site.name)
        redirect_url = add_preserved_filters({'preserved_filters': preserved_filters, 'opts': opts}, redirect_url)
        return HttpResponseRedirect(redirect_url)
    else:
        msg = (_('The    %(name)s    "%(obj)s"    was    changed    successfully.') % msg_dict)
        self.message_user(request, msg, messages.SUCCESS)
        return self.response_post_save_change(request, obj)
