#19059: New {% decode %} tag
-------------------------------+--------------------
     Reporter:  mrechte        |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Uncategorized  |    Version:  1.4
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 Hello,

 I would really appreciate a standard "decode" tag that would do a value
 decoding. Syntax would be:

 {% decode var value1 newvalue1 [value2 newvalue2...] [default_value] %}

 Examples:
 {% decode weather_forecast 'with' 'selected' %}
 If weather_forecast equals 'with' return 'selected' else returns ''

 {% decode category '12' '1' '13' '1', '14' '2' '0' %}
 If category equals '12', '13' returns '1'
 If category equals '14' returns '2'
 Any other value returns '0'

 Thanks

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19059>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to