Or back port the elif tag (which may or may not be non trivial).
On Wednesday, December 28, 2011 at 1:50 AM, Russell Keith-Magee wrote:
On Wed, Dec 28, 2011 at 2:44 PM, Tsung-Hsien <jasoniem9246@gmail.com> wrote:Hi,I want to use {% elif %}my template:{% if bookmark.hours %}{{ bookmark.hours }} hours ago{% elif bookmark.days %}{{ bookmark.days }} days ago{% elif bookmark.months %}{{ bookmark.months }} months ago{% else %}{{ bookmark.years }} years ago{% endif %}show error:Invalid block tag: 'elif', expected 'else' or 'endif'It can work without elif, if use if...else loop.my django version is 1.31how to solve this?The {% elif %} tag was only recently added to Django; it will beavailable in the 1.4 release. Django 1.3 and earlier does not, andwill not ever contain the {% elif %} tag.You can either develop your site against Django's trunk in the hopethat Django will release 1.4 before you need to roll out your site, ormodify your template to use nested {% if %} statements.Yours,Russ Magee %-)--You received this message because you are subscribed to the Google Groups "Django users" group.To post to this group, send email to django-users@googlegroups.com.To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment