Opened 20 years ago
Closed 18 years ago
#546 closed defect (fixed)
[patch] make render_to_string and render_to_response use select_template
| Reported by: | Owned by: | cmcavoy | |
|---|---|---|---|
| Component: | Template system | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The attached patch looks for a ";" in the template_name. If there is one, it will split the template_name on ";" and use the resulting list with select_template instead of passing on the template_name to get_template. That way the shortened rendering syntax can be used with template-selection, too.
Attachments (2)
Change History (8)
by , 20 years ago
| Attachment: | template_loader.diff added |
|---|
comment:1 by , 20 years ago
I'd like this a lot better if you could pass a list instead of a string with semicolons in it. The latter seems hacky and unintuitive. What do you think?
comment:2 by , 20 years ago
Sure, would be fine by me - I just thought the
if type(template_name) in (list, tuple):
select_template(...)
else:
get_template(...)
would seem hacky ;-)
by , 20 years ago
| Attachment: | template_loader.2.diff added |
|---|
version of the patch that switches on (list/tuple) or string and uses select_template or get_template
comment:3 by , 18 years ago
| Component: | Admin interface → Template system |
|---|---|
| Triage Stage: | Unreviewed → Design decision needed |
Looks strange to me, and it seems it wasn't really needed, but I'm just passing this on for decision.
comment:4 by , 18 years ago
| Triage Stage: | Design decision needed → Accepted |
|---|
comment:5 by , 18 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
Taking a sprinting stab at it.
patch to render_to_string to make use of select_template