#14333: Template Ternary Operator -----------------------------+---------------------------------------------- Reporter: scottix | Owner: nobody Status: new | Milestone: Component: Template system | Version: 1.2 Keywords: ternary if | Stage: Unreviewed Has_patch: 0 | -----------------------------+---------------------------------------------- Hey guys new django user here, I really like what you guys are doing. The feature request I am presenting is small but I think would be a good addition. I think there needs to a Ternary operator in your template system.
I know you can do {% if <var1> %}<var1>{% else %}<var2>{% endif %} Seems a little overkill for just needing to display one variable over the other. My suggestion is create a ternary operator. {% <var1> ? <var1> : <var2> %} It could be cut down even more by this. {% <var1> ? <var2> %} I think this is a great way to reduce code markup and make it more readable. Thank you for your time. Scottix -- Ticket URL: <http://code.djangoproject.com/ticket/14333> Django <http://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-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.