title: Django admin model add_view: how to remove "save and add another" buttons?
body: <p>I was able to remove the "save and add another" and "save and continue editing" buttons by implementing the following code:</p>
  
  <pre><code># At the start of my admin.py file I have:
  from django.contrib.admin.templatetags.admin_modify import *
  from django.contrib.admin.templatetags.admin_modify import submit_row as original_submit_row
  
  @register.inclusion_tag('admin/submit_line.html', takes_context=True)
  def submit_row(context):
      ctx = original_submit_row(context)
      ctx.update({
          'show_save_and_add_another': context.get('show_save_and_add_another', ctx['show_save_and_add_another']),
          'show_save_and_continue': context.get('show_save_and_continue', ctx['show_save_and_continue'])
          })
      return ctx
  
  class MyModelAdmin(GuardedModelAdmin):
  # Then inside MyModelAdmin I have this:
      def change_view(self, request, object_id, form_url='', extra_context=None):
          extra_context = extra_context or {}
          extra_context['show_save_and_add_another'] = False
          extra_context['show_save_and_continue'] = False
          return super(MyModelAdmin, self).change_view(request, object_id,
              form_url, extra_context=extra_context)
  </code></pre>
  
  <p>This works great when I'm using my change_view, but when I'm adding a new instance of the model, the buttons reappear. I tried the following:</p>
  
  <pre><code>    def add_view(self, request, form_url='', extra_context=None):
          extra_context = extra_context or {}
          extra_context['show_save_and_add_another'] = False
          extra_context['show_save_and_continue'] = False
          return super(MyModelAdmin, self).add_view(self, request, form_url='', extra_context=extra_context)
  </code></pre>
  
  <p>But it gives me a bizarre MissingAtrribute error -- here's the traceback:</p>
  
  <pre><code>Traceback:
  File "/home/username/.virtualenvs/MyProject/lib/python3.3/site-packages/django/core/handlers/base.py" in get_response
    114.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/username/.virtualenvs/MyProject/lib/python3.3/site-packages/django/contrib/admin/options.py" in wrapper
    432.                 return self.admin_site.admin_view(view)(*args, **kwargs)
  File "/home/username/.virtualenvs/MyProject/lib/python3.3/site-packages/django/utils/decorators.py" in _wrapped_view
    99.                     response = view_func(request, *args, **kwargs)
  File "/home/username/.virtualenvs/MyProject/lib/python3.3/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
    52.         response = view_func(request, *args, **kwargs)
  File "/home/username/.virtualenvs/MyProject/lib/python3.3/site-packages/django/contrib/admin/sites.py" in inner
    198.             return view(request, *args, **kwargs)
  File "/home/username/Development/MyProject/webapp/MyModel/admin.py" in add_view
    153.         return super(MyModelAdmin, self).add_view(self, request, form_url='', extra_context=extra_context)
  File "/home/username/.virtualenvs/MyProject/lib/python3.3/site-packages/django/utils/decorators.py" in _wrapper
    29.             return bound_func(*args, **kwargs)
  File "/home/username/.virtualenvs/MyProject/lib/python3.3/site-packages/django/utils/decorators.py" in _wrapped_view
    95.                     result = middleware.process_view(request, view_func, args, kwargs)
  File "/home/username/.virtualenvs/MyProject/lib/python3.3/site-packages/django/middleware/csrf.py" in process_view
    111.                 request.COOKIES[settings.CSRF_COOKIE_NAME])
  
  Exception Type: AttributeError at /admin/MyModel/ModelInstance/add/
  Exception Value: 'MyModelAdmin' object has no attribute 'COOKIES'
  </code></pre>
  
  <p>I'm using django-guardian and wondering if this is somehow causing my problem? Does anyone know how to get rid of these annoying buttons from the submit_line part of the template when adding a new model instance?</p>