> Returns a list of template names to search for when rendering the
template.
> If template_name is specified, the default implementation will return
a list containing template_name (if it is specified).
https://docs.djangoproject.com/en/1.9/ref/class-based-views/mixins-
simple/#django.views.generic.base.TemplateResponseMixin.get_template_names
What kind of searching does happen here?
I don't understand why a list gets returned and not a single name.
--
Ticket URL: <https://code.djangoproject.com/ticket/26376>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Old description:
> I am missing what "search" means in the current docs of
> `get_template_names`:
>
> > Returns a list of template names to search for when rendering the
> template.
> > If template_name is specified, the default implementation will
> return a list containing template_name (if it is specified).
>
> https://docs.djangoproject.com/en/1.9/ref/class-based-views/mixins-
> simple/#django.views.generic.base.TemplateResponseMixin.get_template_names
>
> What kind of searching does happen here?
>
> I don't understand why a list gets returned and not a single name.
New description:
I am missing what "search" means in the current docs of
`get_template_names`:
> Returns a list of template names to search for when rendering the
template.
> If template_name is specified, the default implementation will return a
list containing template_name (if it is specified).
https://docs.djangoproject.com/en/1.9/ref/class-based-views/mixins-
simple/#django.views.generic.base.TemplateResponseMixin.get_template_names
What kind of searching does happen here?
I don't understand why a list gets returned and not a single name.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/26376#comment:1>
* has_patch: 0 => 1
* stage: Unreviewed => Accepted
Comment:
If I add "The first template that is found will be used." does it help?
There are several other places in Django that have similar behavior so
it's not really a new concept.
--
Ticket URL: <https://code.djangoproject.com/ticket/26376#comment:2>
Comment (by guettli):
Yes "The first template that is found will be used." is more explicit
than "searched". Thank you
--
Ticket URL: <https://code.djangoproject.com/ticket/26376#comment:3>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"6dd503851c91197364f7c7b915cabb604fadb755" 6dd50385]:
{{{
#!CommitTicketReference repository=""
revision="6dd503851c91197364f7c7b915cabb604fadb755"
Fixed #26376 -- Clarifed meaning of 'search' in
TemplateResponseMixin.get_template_names() docs.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26376#comment:4>
Comment (by Tim Graham <timograham@…>):
In [changeset:"4e80ec6a7bb59f6b6ef7ad8153d715098b2c9463" 4e80ec6a]:
{{{
#!CommitTicketReference repository=""
revision="4e80ec6a7bb59f6b6ef7ad8153d715098b2c9463"
[1.9.x] Fixed #26376 -- Clarifed meaning of 'search' in
TemplateResponseMixin.get_template_names() docs.
Backport of 6dd503851c91197364f7c7b915cabb604fadb755 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26376#comment:5>