Opened 14 years ago
Closed 12 years ago
#17356 closed New feature (fixed)
Allow {% include %} to render compiled templates on the context
| Reported by: | Chris Beaven | Owned by: | nobody |
|---|---|---|---|
| Component: | Template system | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | FunkyBob | Triage Stage: | Ready for checkin |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
A fanciful example:
template = template.Template('Buy me {% include subtemplate %}.') context = template.Context({ 'subtemplate': template.Template('some {{ produce }}'), 'produce': 'apples', }) print template.render(context)
Attachments (1)
Change History (8)
by , 14 years ago
| Attachment: | 17356.diff added |
|---|
comment:1 by , 14 years ago
| Triage Stage: | Unreviewed → Design decision needed |
|---|
comment:3 by , 14 years ago
Well, personally I had the case a while back when I wanted to use a dynamically built sub-template like this.
More recently, someone asked about this in IRC. I had a quick look and saw it was easy to implement.
comment:4 by , 13 years ago
| Triage Stage: | Design decision needed → Accepted |
|---|
comment:6 by , 12 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|---|
| Version: | 1.3 → master |
comment:7 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Patch with test & docs