Essential SQLAlchemy by Jason Myers & Rick Copeland
Author:Jason Myers & Rick Copeland
Language: eng
Format: epub
Publisher: O'Reilly Media, Inc.
Published: 2015-12-08T16:00:00+00:00
Ordering
If you were to look at all the results from Example 7-6 instead of just the first record, you would see that the data is not really in any particular order. However, if we want the list to be returned in a particular order, we can chain an order_by() statement to our select, as shown in Example 7-7. In this case, we want the results to be ordered by the quantity of cookies we have on hand.
Example 7-7. Order by quantity ascending
for cookie in session.query(Cookie).order_by(Cookie.quantity): print('{:3} - {}'.format(cookie.quantity, cookie.cookie_name))
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7782)
Grails in Action by Glen Smith Peter Ledbrook(7696)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6419)
Kotlin in Action by Dmitry Jemerov(5066)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3804)
Mastering Azure Security by Mustafa Toroman and Tom Janetscheck(3330)
Learning React: Functional Web Development with React and Redux by Banks Alex & Porcello Eve(3088)
Mastering Bitcoin: Programming the Open Blockchain by Andreas M. Antonopoulos(2868)
The Art Of Deception by Kevin Mitnick(2606)
Drugs Unlimited by Mike Power(2467)
Kali Linux - An Ethical Hacker's Cookbook: End-to-end penetration testing solutions by Sharma Himanshu(2313)
The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution by Walter Isaacson(2304)
Writing for the Web: Creating Compelling Web Content Using Words, Pictures and Sound (Eva Spring's Library) by Lynda Felder(2262)
SEO 2018: Learn search engine optimization with smart internet marketing strategies by Adam Clarke(2194)
A Blueprint for Production-Ready Web Applications: Leverage industry best practices to create complete web apps with Python, TypeScript, and AWS by Dr. Philip Jones(2182)
JavaScript by Example by S Dani Akash(2138)
DarkMarket by Misha Glenny(2083)
Wireless Hacking 101 by Karina Astudillo(2077)
Full-Stack React Projects by Shama Hoque(1990)
