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 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,512 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.