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!
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
MUZ140249 Sibusisiwe Dube2,900 Points
challenge task 4 of 4
meet peewee; am getting a bummer which says challenge not in ascending order insted it is 1,5,2,. i don' t know where i am missing it. please help. thanks
from models import Challenge all_challenges = Challenge.select() Challenge.create(language='Ruby', name='Booleans') sorted_challenges = all_challenges.select().order_by()
Bhupend Patil25,918 Points
.select() in 2nd step so you don't have to write it again.
Should look like this:
sorted_challenges = all_challenges.order_by() .
But then you have to specify records ordered by the
steps attribute on the model i.e from imported Challenge class
So finally ordered by should look like this:
Annie Scott27,613 Points
TASK 1 - 4
from models import Challenge
all_challenges = Challenge.select()
sorted_challenges = all_challenges.order_by(Challenge.steps)
Henry Howes4,767 Points
This question asks that the challenges be ordered with the steps attribute of Challenge, so this must be passed as a parameter to order_by().