Section 10.4. Summary

10.4. Summary

  • SQLObject implements the Active-Record pattern.

  • Use ?debug=True to have SQLObject print the SQL queries it generates to the console.

  • SQLObject manages your database connections for you, and in TurboGears it gets the connection string from dev.cfg or prod.cfg.

  • In addition to defining your classes first and generating you database tables from those classes the way we've been doing it in this book, you can also use _fromDatabase=true.

  • SQLObject provides several different ways to define queries. The simplest of these is get(ID), but select() is just about as easy.

  • Only slightly more complex is the selectBy() method, which you can use to get records matching specific criteria.

Rapid Web Applications with TurboGears(c) Using Python to Create Ajax-Powered Sites
Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites
ISBN: 0132433885
EAN: 2147483647
Year: 2006
Pages: 202

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: