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

Challenge Task 3 of 4: I'm not sure what I am doing wrong, but I can't create a new 'Challenge' object with attributes.

The return response: "I don't see a Ruby Boolean 'Challenge'. I'm not sure what error I am causing.

queries.py
from models import Challenge
all_challenges = Challenge.select()
an = Challenge("Ruby", "Booleans")

2 Answers

Dan Johnson
Dan Johnson
40,532 Points

It's expecting an entry into the challenge table in the database, so you'll want to call the class method create on Challenge.

this worked for me:

from models import Challenge 

all_challenges = Challenge.select()

Challenge.create(language = "Ruby", name = "Booleans")