| | 12 | |
| | 13 | 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;- |
| | 14 | {{{ |
| | 15 | |
| | 16 | from django import template |
| | 17 | |
| | 18 | register = template.Library() |
| | 19 | |
| | 20 | @register.filter(name='specialbracket') |
| | 21 | def specialbracket(value): |
| | 22 | if value == 'left': |
| | 23 | return "{{" |
| | 24 | elif value == 'right': |
| | 25 | return "}}" |
| | 26 | else: |
| | 27 | return "??" |
| | 28 | }}} |
| | 29 | |
| | 30 | And the above example solved with this tag;- |
| | 31 | |
| | 32 | {{{ |
| | 33 | <td class="field-{{ident}}">{{ 'left'|specialbracket }} computer.{{field}} {{ 'right'|specialbracket }} </td> |
| | 34 | |
| | 35 | }}} |