Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In short, here's what's happening currently: a <a href="https://docs.djangoproject.com/en/dev/ref/class-based-views/generic-editing/#django.views.generic.edit.DeleteView" rel="nofollow">DeleteView</a> in Django will render a default template based on the class name as explained in the docs:</p> <blockquote> <p>The <code>DeleteView</code> page displayed to a GET request uses a <code>template_name_suffix</code> of <code>'_confirm_delete'</code>.</p> </blockquote> <p>To change this, just overrule this behaviour by providing the <a href="https://docs.djangoproject.com/en/dev/ref/class-based-views/mixins-simple/#django.views.generic.base.TemplateResponseMixin.template_name" rel="nofollow"><code>template_name</code> argument</a>:</p> <blockquote> <p><code>template_name</code></p> <p>The full name of a template to use as defined by a string.</p> </blockquote> <p>This works for any built-in class based view inheriting from a TemplateResponseMixin.</p> <p>Apply it in the class definition <em>or</em> in the URL patterns (whichever you prefer):</p> <ul> <li><p>In the class:</p> <pre><code>class MyOwnPictureDeleteView(PictureDeleteView): template_name = "myown_picture_delete_template.html" </code></pre> <p>Yes, that's your complete new class based view.</p> <p><strong>or</strong></p></li> <li><p>In URLconf:</p> <pre><code>url(r'^picture_delete/(?P&lt;pk&gt;\d+)/', 'myapp.views.PictureDeleteView', \ {'template_name': 'myown_picture_delete_template.html'}), </code></pre></li> </ul> <p>Either way, you don't have to rewrite a single line of the original PictureDeleteView class, so this is as DRY as it gets.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload