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 trialChase Svoboda
Python Development Techdegree Graduate 8,466 PointsAm I suppose to make an Instance or something else? What is it asking me to do here?
I'm still learning on how to use classes, and I thought I would just add an instance(?). Am I right to think that? Or do I need to do something else? Just looking for hints!
from models import Challenge
all_challenges = Challenge.select()
all_challenges.Challenge(language="Ruby", name="Boolean")
1 Answer
Jeff Muday
Treehouse Moderator 28,722 PointsYou're pretty close on the syntax, but we have to create a new challenge and save it to the database. The way I show below isn't the only way to do it.
Good luck with your Python journey!
from models import Challenge
# this has all Challenges from the database
all_challenges = Challenge.select()
# create a new single Challenge instance and SAVE it.
new_challenge = Challenge(language="Ruby", name="Booleans")
new_challenge.save()
Chase Svoboda
Python Development Techdegree Graduate 8,466 PointsChase Svoboda
Python Development Techdegree Graduate 8,466 PointsThank you for the help!