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

Keith Whatling
Keith Whatling
17,759 Points

customising Django templates flavors of ice cream |length

I am having issues with the questions on this new django course Customizing Django Templates, despite my answers working elsewhere I cant for the life of me get them to work on the tests.

{{ flavors.step_set.all|length }} should work, anyone got any ideas?

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

        <div>We have {{ flavors.step_set.all|length }} flavors today.</div>

        <ul>

        </ul>

    </body>
</html>

3 Answers

Seth Reece
Seth Reece
32,867 Points

Hi Keith,

According to this post you want to use:

{{ flavors|length }}

I only got that to pass by deleting the comment:

<!-- YOUR CODE HERE -->

I'll agree that it's a little confusing seeing as the course used the same code you tried.

Keith Whatling
Keith Whatling
17,759 Points

Yes the tutorial goes over step_set and it would seem as though that would be correct. not the clearest questions in this course. #BringBackKennith

Chris Christensen
Chris Christensen
9,281 Points

I'll second that one. There is nothing in the course that points to this being the answer.