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 trialHolden Glass
6,077 PointsNot sure what to do.
I have no idea what I need to do for this challenge. Any help is appreciated.
from models import Challenge
def create_challenge(name, language, steps=1):
Challenge.create(name=name,
language=language,
steps=steps)
def search_challenges(name, language):
return Challenge.select().where(Challenge(name==name, language==language))
2 Answers
Alx Ki
Python Web Development Techdegree Graduate 14,822 PointsHi, Holden Glass !
The challenge wants you to use .contains() with name and equality with language.
Here are the DOCS for it
Holden Glass
6,077 PointsOh. Ok. Thank you very much. I was a little bit unsure on what to do.
Alx Ki
Python Web Development Techdegree Graduate 14,822 PointsYou're welcome ;)
Holden Glass
6,077 PointsHolden Glass
6,077 PointsYou mean like this?
Holden Glass
6,077 PointsHolden Glass
6,077 PointsI meant to put the double equal signs in there. It still didn't work
Alx Ki
Python Web Development Techdegree Graduate 14,822 PointsAlx Ki
Python Web Development Techdegree Graduate 14,822 PointsLike this:
Challenge.select().where(Challenge.name.contains(the_name), Challenge.language==the_language)
Return all Challenges where:
name field contains name argument
and
the language field is equal to the language argument.