Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Flask REST API Resourceful Blueprints Ingredient Resource

Devin Roark
Devin Roark
4,608 Points

getting a mysterious 'bummer try again' with the models task

Not looking for the answer just want to know where i need to look to fix this code that's getting the mysterious "bummer" message (note to teachers: a stack trace would be super useful instead of that)

class Ingredient(Model):
    recipe = ForeignKey(Recipe, related_name='ingredient_recipe')
    name = CharField()
    description = CharField()
    quantity = DecimalField()
    measurement_type = CharField()

    class Meta:
        database = DATABASE

2 Answers

According to the documentation linked in the challenge it is ForeignKeyField not ForeignKey.

Devin Roark
Devin Roark
4,608 Points

Thank you Kris that was my problem.

(addressing the broader public) But again, a situation where getting a NameError traceback rather than the "Bummer" message would be much more helpful.