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 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)

models.py
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.