Chapter 13. List Comprehensions: Database Integrations
With your database tables ready, it’s time to integrate.
Your webapp can gain the flexibility the Coach requires by using the datasets in your database tables, and in this chapter you create a module of utilities that lets your webapp exploit your database engine. And, in a never-ending quest to do more with less code, you’ll learn how to read and write list comprehensions, which are a genuine Python superpower. You’ll also reuse a lot of your pre-existing code in new and interesting ways, so let’s get going. There’s lots of integration work to do.
We’re looking forward to that, too.
To help us get there, the Head First Coders, concerned that our SQL skills might be a bit rusty, have sent over a file of SQL queries for you to consider using with your webapp.
The Coders suggested you’ll need to do a bit of extra work to use these queries to tackle Task #3 and #4, but they think the queries will help extract the data your webapp needs.
Recall the next two tasks, then take a look at the queries (copied from queries.py) on the next page.
Extract the data you need from your database tables.At the moment, your webapp’s code ...