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 Gettin' CRUD-y With It CRUD: Create Function

I keep receiving the error "didn't find the challenge I asked you to create.

Not sure what I am supposed to do.

I have tried:

challenge = create_challenge('bobo the cat', 'Meow Meow') and also just calling the function as in the code below.

crud.py
from models import Challenge

def create_challenge(name, language, steps=1):
    Challenge(name, language, steps)

create_challenge('Bobo the cat', 'meow meow')

1 Answer

I was able to find the answer.

Challenge.create(name=name, language=language, steps=steps)

is what the error was asking for. I am not sure if it's available, but having access to the module that is imported would have made the question more understandable to me, as I forgot that the class Challenge is a database.

Mark Sebeck
Mark Sebeck
Treehouse Moderator 37,905 Points

Joshuat, glad you were able to solve your problem and posted back that you did. I changed your comment to an answer and marked it the best answer. Keep at it!