Permalink
Browse files

Merge pull request #104 from njl/fix-issue-77

Fix issue #77
  • Loading branch information...
mitsuhiko committed May 19, 2013
2 parents 55ea1df + 7336b7a commit c5005a7edfc578265ccef4026d4c30a0124d1361
Showing with 19 additions and 3 deletions.
  1. +19 −3 docs/switching.rst
View
@@ -177,9 +177,25 @@ operator. Here are some examples::
Loops
~~~~~
-For loops work very similar to Django, the only incompatibility is that in
-Jinja2 the special variable for the loop context is called `loop` and not
-`forloop` like in Django.
+For loops work very similar to Django. Notably, in Jinja2 the special variable for
+the loop context is called `loop` and not `forloop` like in Django.
+
+In addition, the Django `empty` argument is called `else` in Jinja2. For example, the
+Django template::
+
+ {% for item in items %}
+ {{item}}
+ {% empty %}
+ No items!
+ {% endfor %}
+
+would be handled in Flask as::
+
+ {% for item in items %}
+ {{item}}
+ {% else %}
+ No items!
+ {% endfor %}
Cycle
~~~~~

0 comments on commit c5005a7

Please sign in to comment.