'Determines the HttpResponse for the add_view stage.'

def response_add(self, request, obj, post_url_continue=None):

    opts = obj._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 (IS_POPUP_VAR in request.POST):
        return SimpleTemplateResponse('admin/popup_response.html', {'pk_value': escape(pk_value), 'obj': escapejs(obj)})
    elif ('_continue' 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)
        if (post_url_continue is None):
            post_url_continue = reverse(('admin:%s_%s_change' % (opts.app_label, opts.model_name)), args=(pk_value,), current_app=self.admin_site.name)
        post_url_continue = add_preserved_filters({'preserved_filters': preserved_filters, 'opts': opts}, post_url_continue)
        return HttpResponseRedirect(post_url_continue)
    elif ('_addanother' in request.POST):
        msg = (_('The    %(name)s    "%(obj)s"    was    added    successfully.    You    may    add    another    %(name)s    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)
    else:
        msg = (_('The    %(name)s    "%(obj)s"    was    added    successfully.') % msg_dict)
        self.message_user(request, msg, messages.SUCCESS)
        return self.response_post_save_add(request, obj)
