Changes between Version 2 and Version 3 of Ticket #23356


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

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23356 – Description

    v2 v3  
    1010BTW: This part of the Django code did not change from 1.6 up to master.
    1111
    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 }}}
Back to Top