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 Using Databases in Python Meet Peewee First Queries

stage1 meet PEEWEE

Now, create a variable named all_challenges. It should select all of the available challenges from the database

from models import Challenge
all_challenges = challenges.select
Eric Carter
Eric Carter
5,066 Points

You're missing something there at the end :D

2 Answers

There are a couple of issues with your code that you need to solve.

First, on line 2 you reference a variable challenges that doesn't exist. Look at what you imported on line 1 and update line 2 accordingly.

Secondly, if you look at the Teacher's Notes section on http://teamtreehouse.com/library/using-databases-in-python/meet-peewee/queries-are-your-friend you will see the method call you need to use on the class you imported and how to call it.

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

It's also a method we use in the video itself.

all_challenges = Challenge.select()

luke hammer
luke hammer
25,513 Points

sorry negative point given for just giving away the answer for the quiz when there was already good notes given where to find the answer. Including a comment from the teacher.