Ticket #11949: 11949-r12889-with-docs.diff

File 11949-r12889-with-docs.diff, 2.5 KB (added by Ramiro Morales, 15 years ago)

Patch by bendavis78 updated to r12889 plus a documentation blurb addition

  • django/contrib/admin/actions.py

    diff -r 6d68cf0600e5 django/contrib/admin/actions.py
    a b  
    6868    }
    6969
    7070    # Display the confirmation page
    71     return render_to_response(modeladmin.delete_confirmation_template or [
     71    return render_to_response(modeladmin.delete_selected_confirmation_template or [
    7272        "admin/%s/%s/delete_selected_confirmation.html" % (app_label, opts.object_name.lower()),
    7373        "admin/%s/delete_selected_confirmation.html" % app_label,
    7474        "admin/delete_selected_confirmation.html"
  • django/contrib/admin/options.py

    diff -r 6d68cf0600e5 django/contrib/admin/options.py
    a b  
    206206    change_form_template = None
    207207    change_list_template = None
    208208    delete_confirmation_template = None
     209    delete_selected_confirmation_template = None
    209210    object_history_template = None
    210211
    211212    # Actions
  • docs/ref/contrib/admin/index.txt

    diff -r 6d68cf0600e5 docs/ref/contrib/admin/index.txt
    a b  
    741741
    742742    Path to a custom template, used by :meth:`history_view`.
    743743
     744.. attribute:: ModelAdmin.delete_selected_confirmation_template
     745
     746    .. versionadded:: 1.2
     747
     748    Path to a custom template, used by the ``delete_selected`` action method
     749    for displaying a confirmation page when deleting one or more objects. See
     750    the :ref:`actions documentation<ref-contrib-admin-actions>`.
     751
    744752
    745753.. _model-admin-methods:
    746754
  • tests/regressiontests/admin_views/models.py

    diff -r 6d68cf0600e5 tests/regressiontests/admin_views/models.py
    a b  
    119119    add_form_template = 'custom_admin/add_form.html'
    120120    object_history_template = 'custom_admin/object_history.html'
    121121    delete_confirmation_template = 'custom_admin/delete_confirmation.html'
     122    delete_selected_confirmation_template = 'custom_admin/delete_selected_confirmation.html'
    122123
    123124    def changelist_view(self, request):
    124125        "Test that extra_context works"
  • new file tests/templates/custom_admin/delete_selected_confirmation.html

    diff -r 6d68cf0600e5 tests/templates/custom_admin/delete_selected_confirmation.html
    - +  
     1{% extends "admin/delete_selected_confirmation.html" %}
Back to Top