12 | | For the purposes of anyone coming across this ticket and pulling their hair out over it, heres a template tag that might ease the pain;- |
13 | | {{{ |
14 | | |
15 | | from django import template |
16 | | |
17 | | register = template.Library() |
18 | | |
19 | | @register.filter(name='specialbracket') |
20 | | def specialbracket(value): |
21 | | if value == 'left': |
22 | | return "{{" |
23 | | elif value == 'right': |
24 | | return "}}" |
25 | | else: |
26 | | return "??" |
27 | | }}} |
28 | | |
29 | | And the above example solved with this tag;- |
30 | | |
31 | | {{{ |
32 | | <td class="field-{{ident}}">{{ 'left'|specialbracket }} computer.{{field}} {{ 'right'|specialbracket }} </td> |
33 | | |
34 | | }}} |