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 A Social Network with Flask How to Win Friends Related Users

Andy Hughes
Andy Hughes
8,479 Points

These code challenge descriptions are just soooo confusing at times! Write like a normal person, please!

I sat staring at this challenge for a good 10mins, thinking "Is he asking me to do this or this because I can't really tell." Then I spent another 10-15mins going over videos again. Then I'm like "nope, what he's asking me to do hasn't been covered like he's asking me to do it, or has it and I'm just too stupid to see it?"

Time and time again, the code challenge descriptions are written in an back to front, upside down, right to top way. They do more to confuse than help you practice and remember what has been demonstrated in the videos.

For example:

Actual Challenge Description:

Add a new model named Relationship. It should have a ForeignKeyField, related to User. The field should be named from_user with a related_name of "relationships".

What this really translates to in practice is:

Create a new model named Relationship. Then inside that model, create a variable called 'from_user'. Give it a 'ForeignKeyField type that shows a related_name of "relationships" and is related to "User".

Don't judge my terminology (I'm not an experienced Python programmer), but I'm sure that tells you more clearly what needs to be done.

For someone new to Python, trying to remember the gazillion things Kenneth is talking about in the videos (often whilst introducing new code, that he doesn't explain, or going over things from older videos, which he doesn't relate back to), there is no real value to me trying to confuse me even further with ambiguous, vague, riddle like code challenges.

And this is only step 1 of 4. Heaven help me. Come on Treehouse, at least do these things from a learner's perspective, not an experienced coder.

Seriously frustrated!

models.py
import datetime

from flask.ext.bcrypt import generate_password_hash
from flask.ext.login import UserMixin
from peewee import *

DATABASE = SqliteDatabase(':memory:')


class User(UserMixin, Model):
    email = CharField(unique=True)
    password = CharField(max_length=100)
    join_date = DateTimeField(default=datetime.datetime.now)
    bio = CharField(default='')

    class Meta:
        database = DATABASE

    @classmethod
    def new(cls, email, password):
        cls.create(
            email=email,
            password=generate_password_hash(password)
        )


class LunchOrder(Model):
    order = TextField()
    date = DateField()
    user = ForeignKeyField(User, related_name="orders")


class Relationship(Model):
    from_user = ForeignKeyField(User, related_name="relationships")
    to_user = ForeignKeyField(User, related_name="related_to")


def initialize():
    DATABASE.connect()
    DATABASE.create_tables([User, LunchOrder], safe=True)
    DATABASE.close()

2 Answers

Andy Hughes
Andy Hughes
8,479 Points

Why would I bother contacting support? It is scant at best. I've been here before trying to learn PHP and support back then was next to useless (3-4yrs ago) The community is by far the best source of support.

However, as this forum represents the community of students who use Treehouse, I still believe it's an important place to air frustrations and shout the successes. I suspect I'm not alone in feeling my frustrations and if enough people feel the same way, then contacting support becomes more likely to yield action.

At the moment, I'm just a lone wolf, having a howl. :)

Steven Parker
Steven Parker
231,275 Points

I thought you were suggesting changes to the courses, and only the staff can do that.
But if your intention is just to share with other students, this is the right place.   :+1:

Steven Parker
Steven Parker
231,275 Points

Remember that the forum is primarily used by other students. If you have an issue that requires staff attention, you are more likely to reach them by contacting Support directly.