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 Build a Social Network with Flask How to Win Friends Show Follower Posts

Not sure what's wrong in my solution for the "Lunch Count" code challenge

Everything seems OK in the Preview my preview But I get the message: "Bummer! Didn't find the right number of orders in the template" I can't figure out what the problem is.

templates/profile.html

{% extends "layout.html" %}
{% from "macro.html" import hide_email %}

{% block content %}

<h1>{{ hide_email(user) }}</h1>

<dl>
    <dt>Lunches:</dt>
    <dd><!-- total # of lunches ordered -->
      {{ user.orders.count() }}
    </dd>
    <dt>Followers:</dt>
    <dd><!-- # of followers. user.followers is a queryset of followers -->
      {{ user.followers.count() }}
    </dd>
    <dt>Following:</dt>
    <dd><!-- # of users followed. user.following is a queryset of users followed -->
      {{ user.following.count() }}
    </dd>
</dl>

{% endblock %}
Vittorio Somaschini
Vittorio Somaschini
33,371 Points

Hey dataxploit.

I have removed the rest of the code that you had attached as the only file that we are editing is templates/profile.html. I think this helps readability, I hope you don't mind ;)

Vitto

1 Answer

Vittorio Somaschini
Vittorio Somaschini
33,371 Points

Hello dataxploit.

I am not 100% sure but it could be the fact that you did NOT remove the comments and placed the code straight in there (between the dd tags on the same line).

Please try to do that and see if that works, the lines of code look fine to me. So just get rid of the comments and place the relative code there and see if it helps.

Let me know, Vitto

Yeah, after removing the comments, and reformatting a little bit, the code was accepted. Thanks. That was kinda weird.