It is available in dev/trunl version not this version.
This is dev version docs
https://docs.djangoproject.com/en/dev/ref/templates/builtins/
On Wed, Dec 28, 2011 at 12:20 PM, Russell Keith-Magee <russell@keith-magee.com> wrote:
On Wed, Dec 28, 2011 at 2:44 PM, Tsung-Hsien <jasoniem9246@gmail.com> wrote:The {% elif %} tag was only recently added to Django; it will be
> 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.31
>
> how to solve this?
available in the 1.4 release. Django 1.3 and earlier does not, and
will not ever contain the {% elif %} tag.
You can either develop your site against Django's trunk in the hope
that Django will release 1.4 before you need to roll out your site, or
modify 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.
--
Regards
Nikhil Verma
+91-958-273-3156
--
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