Python Using Databases in Python Meet Peewee First Queries

Please assist me to sort in ascending order

I cannot sort in ascending order

queries.py
from models import Challenge
all_challenges= Challenge.select()
booleans=Challenge.create(language='Ruby',name='Booleans')
sorted_challenges="SELECT * FROM Challenge ORDER BY steps"

1 Answer

Hi guys this is the solution i made for the task

from models import Challenge

all_challenges=Challenge.select() new_challenge=Challenge.create(language='Ruby',name='Booleans') sorted_challenges=Challenge.select().order_by(Challenge.steps)