Chapter 12. Customizing SQLObject Behavior

In This Chapter

  • 12.1 Customizing SQLObject Classes with sqlmeta 185

  • 12.2 More-Advanced SQLObject Customization 189

  • 12.3 SQLObject and Inheritance 192

  • 12.4 SQLObject and Transactions 198

  • 12.5 Summary 205

As you've already seen, SQLObject provides you with easy access to your database. You can handle large datasets, create relationships, and write complex queries using SQLBuilder. However, sometimes you need a little bit more power, or a little bit more flexibility. For example, you might need to map classes to existing database names that don't follow the SQLObject conventions, or you might need to write code that explicitly manages transactions to ensure data integrity.

Fortunately, SQLObject still has a few tricks up its sleeve: You can create custom behaviors for SQLObjects, customize the mapping between SQLObjects and the names of the tables they represent, and otherwise create flexible model classes.

This chapter explores the hooks that give you control of what happens when new instances are created, as well as the way SQLObject exposes your DBMS's transaction management system, and the ways that SQLObject helps you match classes built through inheritance with database records.

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: