Opened 16 years ago
Closed 16 years ago
#9701 closed (fixed)
A safelist filter ("safe" for lists)
Reported by: | Malcolm Tredinnick | Owned by: | Malcolm Tredinnick |
---|---|---|---|
Component: | Template system | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Design decision needed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Right now, there's no way for a template designer to indicate that each element in a variable that's a list is "safe" for autoescaping purposes. Using the safe filter would treat the list as a string. For example, as reasonable workaround to #9700 might be to be able to write
{{ some_list|safelist|join:", " }}
Might be worth adding this.
Change History (4)
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 16 years ago
comment:3 by , 16 years ago
No, I'm intentionally not going for anything map-like. Templates are not a programming language.
comment:4 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
More generally, perhaps a map filter or tag? I can imagine
covering more situations, especially if it's lazy.