Jinja2 Mastery: Level 1: Working with filters in Jinja2 (+1, -12)
home.html (+1, -12)
From:
curriculum/section09/lectures/03_jinja2_filters/start/templates/home.html
To:
curriculum/section09/lectures/03_jinja2_filters/end/templates/home.html
index 4dfe278..d58fdf4 100644
--- a/curriculum/section09/lectures/03_jinja2_filters/start/templates/home.html
+++ b/curriculum/section09/lectures/03_jinja2_filters/end/templates/home.html
@@ -6,18 +6,7 @@
<title>Todos</title>
</head>
<body>
- <ul>
- {% for todo in todos %}
- <li>{{ todo }}</li>
- {% endfor %}
- </ul>
-
- <!-- step 2 -->
- {% set friends = 50 %}
- <p>You have {{ friends }} friends.</p>
-
- <!-- step 3 -->
- {% set num_todos = len(todos) %}
+ {% set num_todos = todos | length %}
{% if num_todos > 0 %}
<p>You have {{ num_todos }} things to do today.</p>
{% else %}