template.loader.select_template should return template_name as well.
|Reported by:||DaNmarner||Owned by:||JoshStegmaier|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The whole purpose of this function is to find out which possible location of a certain template is valid. It make sense to return the compiled template as well as its location.
Here's a common use case:
A template is found by select_template, however, this template extends an "base.html" whose is located in the same directory, which is unknown until runtime as well. So the extends tag fails.
If select_template returns the location of the template it finds, then this info could be passed into an context and thus make the extends tag useful again.
Change History (9)
Changed 5 years ago by DaNmarner
comment:1 Changed 5 years ago by DaNmarner
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Summary changed from template.select_template should return template_name as well. to template.loader.select_template should return template_name as well.
Changed 5 years ago by JoshStegmaier
comment:2 Changed 5 years ago by JoshStegmaier
- Owner changed from nobody to JoshStegmaier
- Status changed from new to assigned
comment:3 Changed 5 years ago by JoshStegmaier
- Triage Stage changed from Unreviewed to Design decision needed