parameters: (self)
docstring: Determines the HttpResponse for the add_view stage.
docstring_summary: Determines the HttpResponse for the add_view stage.
docstring_tokens: Determines the HttpResponse for the add_view stage .
function: def post_response(self):
          """
          Determines the HttpResponse for the add_view stage.
          """
          request = self.request
  
          msg = _(
              'The %(name)s "%(obj)s" was added successfully.') % {'name': force_text(self.opts.verbose_name),
                                                                   'obj': "<a class='alert-link' href='%s'>%s</a>" % (self.model_admin_url('change', self.new_obj._get_pk_val()), force_text(self.new_obj))}
  
          if "_continue" in request.POST:
              self.message_user(
                  msg + ' ' + _("You may edit it again below."), 'success')
              return self.model_admin_url('change', self.new_obj._get_pk_val())
  
          if "_addanother" in request.POST:
              self.message_user(msg + ' ' + (_("You may add another %s below.") % force_text(self.opts.verbose_name)), 'success')
              return request.path
          else:
              self.message_user(msg, 'success')
  
              # Figure out where to redirect. If the user has change permission,
              # redirect to the change-list page for this object. Otherwise,
              # redirect to the admin index.
              if "_redirect" in request.POST:
                  return request.POST["_redirect"]
              elif self.has_view_permission():
                  return self.model_admin_url('changelist')
              else:
                  return self.get_admin_url('index')
function_tokens: def post_response ( self ) : request = self . request msg = _ ( 'The %(name)s "%(obj)s" was added successfully.' ) % { 'name' : force_text ( self . opts . verbose_name ) , 'obj' : "<a class='alert-link' href='%s'>%s</a>" % ( self . model_admin_url ( 'change' , self . new_obj . _get_pk_val ( ) ) , force_text ( self . new_obj ) ) } if "_continue" in request . POST : self . message_user ( msg + ' ' + _ ( "You may edit it again below." ) , 'success' ) return self . model_admin_url ( 'change' , self . new_obj . _get_pk_val ( ) ) if "_addanother" in request . POST : self . message_user ( msg + ' ' + ( _ ( "You may add another %s below." ) % force_text ( self . opts . verbose_name ) ) , 'success' ) return request . path else : self . message_user ( msg , 'success' ) # Figure out where to redirect. If the user has change permission, # redirect to the change-list page for this object. Otherwise, # redirect to the admin index. if "_redirect" in request . POST : return request . POST [ "_redirect" ] elif self . has_view_permission ( ) : return self . model_admin_url ( 'changelist' ) else : return self . get_admin_url ( 'index' )