Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed SQLAlchemy Basics!
You have completed SQLAlchemy Basics!
Preview
Clean the data in order to find entries in the database by id. Create functions to support your work.
Challenges
- What if you have 1000 books? What would be a better way of sharing the id options with the user when searching by id?
- What are other ways you could let the user search for a book?
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
First, let's help our user out by
letting them know the range for
0:00
IDs in our database.
0:02
We can do this by creating
0:03
an id_options as a list and
0:08
then do for
book in session.query(Book) and
0:13
then do id_options.append and
0:22
let's do our book.id, okay?
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up