'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()
    msg_dict = {'name': force_text(opts.verbose_name), 'obj': force_text(obj)}
    if ('_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)
        if (post_url_continue is None):
            post_url_continue = reverse(('admin:%s_%s_change' % (opts.app_label, opts.module_name)), args=(pk_value,), current_app=self.admin_site.name)
        else:
            try:
                post_url_continue = (post_url_continue % pk_value)
                warnings.warn('The    use    of    string    formats    for    post_url_continue    in    ModelAdmin.response_add()    is    deprecated.    Provide    a    pre-formatted    url    instead.', DeprecationWarning, stacklevel=2)
            except TypeError:
                pass
        if ('_popup' in request.POST):
            post_url_continue += '?_popup=1'
        return HttpResponseRedirect(post_url_continue)
    if ('_popup' in request.POST):
        return HttpResponse(('<!DOCTYPE    html><html><head><title></title></head><body><script    type="text/javascript">opener.dismissAddAnotherPopup(window,    "%s",    "%s");</script></body></html>' % (escape(pk_value), escapejs(obj))))
    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)
        return HttpResponseRedirect(request.path)
    else:
        msg = (_('The    %(name)s    "%(obj)s"    was    added    successfully.') % msg_dict)
        self.message_user(request, msg)
        return self.response_post_save_add(request, obj)
