Chapter 12.1.4. Lazy Updates and Caching

Let’s keep up with the lazy bum and see the effects of the lazyUpdate and cacheValues settings. By default, SQLObject updates the DB every time you set a column attribute of an instance. This isn’t what you want sometimes (for example, if you need to modify multiple attributes of the same instance). So, lazyUpdate tells SQLObject to wait with the update for an explicit sync() or syncUpdate() call. SQLObject also caches everything by default. If you set lazyUpdate to True, you will probably want to set cacheValues to False so that queries will return the actual state in the DB and not the partial update that might not satisfy the DB schema constraints. Well, this is one area where SQLObject can really ...

Get Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.