Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Customizing Django Templates Template Tags and Filters Lengths and Counts

Not able to pass this challenge

Finally, list all of the flavors of ice cream in the unordered list below. Use either a for tag to list all the flavors in <li> tags or the unordered_list filter.

ice_cream/templates/ice_cream/list.html
<html>
    <head>
        <title>Ice Cream</title>
    </head>
    <body>

        <div>We have {{ flavors.count }} flavors today.</div>

        <ul>
          {% for flavor in flavors %}
            <li>{{flavor}}</li>
          {% end for %}
        </ul>

    </body>
</html>

2 Answers

Alexandra Barnett
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexandra Barnett
Front End Web Development Techdegree Graduate 46,473 Points

Hi Pabba! You were almost there! The end for at to end the for loop shouldn't have a space between the 'end' and the 'for':

<html>
    <head>
        <title>Ice Cream</title>
    </head>
    <body>

        <div>We have {{ flavors.count }} flavors today.</div>

        <ul>
          {% for flavor in flavors %}
            <li>{{flavor}}</li>
          {% endfor %}
        </ul>

    </body>
</html>

Let me know if you have any questions :)

Do you know how to use the unordered_list filter alternative?

Andrew Furzer
seal-mask
.a{fill-rule:evenodd;}techdegree
Andrew Furzer
Python Web Development Techdegree Student 7,364 Points

Similar to the filter for linebreaks creating paragraphs, using the filter |unordered_list is the alternative method.

In this case it would be {{ flavors|unordered_list }}.