1
0
mirror of https://github.com/django/django.git synced 2024-12-22 00:55:44 +00:00

Fixed #26007 -- Clarified SingleObjectTemplateResponseMixin.get_template_names() docs.

This commit is contained in:
Andrew Miller 2024-12-13 16:44:53 +00:00 committed by Sarah Boyce
parent bb6114ce50
commit 0fc6d5362b
2 changed files with 6 additions and 4 deletions

View File

@ -121,9 +121,10 @@ class SingleObjectTemplateResponseMixin(TemplateResponseMixin):
def get_template_names(self): def get_template_names(self):
""" """
Return a list of template names to be used for the request. May not be Return a list of template names to be used for the request. May not be
called if render_to_response() is overridden. Return the following list: called if render_to_response() is overridden. Return a list containing
``template_name``, if set on the value. Otherwise, return a list
containing:
* the value of ``template_name`` on the view (if provided)
* the contents of the ``template_name_field`` field on the * the contents of the ``template_name_field`` field on the
object instance that the view is operating upon (if available) object instance that the view is operating upon (if available)
* ``<app_label>/<model_name><template_name_suffix>.html`` * ``<app_label>/<model_name><template_name_suffix>.html``

View File

@ -164,9 +164,10 @@ Single object mixins
.. method:: get_template_names() .. method:: get_template_names()
Returns a list of candidate template names. Returns the following list: Returns a list of candidate template names. Return a list containing
``template_name``, if set on the value. Otherwise, return a list
containing:
* the value of ``template_name`` on the view (if provided)
* the contents of the ``template_name_field`` field on the * the contents of the ``template_name_field`` field on the
object instance that the view is operating upon (if available) object instance that the view is operating upon (if available)
* ``<app_label>/<model_name><template_name_suffix>.html`` * ``<app_label>/<model_name><template_name_suffix>.html``