Changes between Initial Version and Version 1 of Ticket #23424, comment 7


Ignore:
Timestamp:
Sep 15, 2014, 1:31:10 AM (10 years ago)
Author:
shayneoneill

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23424, comment 7

    initial v1  
    1010
    1111Whilst documentation would at least warn the bug is there, this is a show-stopper error for a lot of use cases.
     12
     13For 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
     16from django import template
     17
     18register = template.Library()
     19
     20@register.filter(name='specialbracket')
     21def specialbracket(value):
     22    if value == 'left':
     23        return "{{"
     24    elif value == 'right':
     25        return "}}"
     26    else:
     27        return "??"
     28}}}
     29
     30And the above example solved with this tag;-
     31
     32{{{
     33        <td class="field-{{ident}}">{{ 'left'|specialbracket }} computer.{{field}} {{ 'right'|specialbracket }} </td>
     34
     35}}}
Back to Top