Give each part of an application one clear job. A data function retrieves orders; a display function and template show whatever data they receive. Change the data request without rewriting the display. section 12.0
The order list
Emily’s order page calls get_orders(), which reads rows from the database. list() passes those rows to list.html, whose loop displays each name, drink, flavor, and topping. Filtering orders changes get_orders(), while the template can keep displaying the returned list.





















