From: <sub...@co...> - 2004-12-29 17:03:27
|
Author: ianb Date: 2004-12-29 17:02:51 +0000 (Wed, 29 Dec 2004) New Revision: 504 Modified: trunk/SQLObject/docs/SQLObject.txt Log: Noted _lazyUpdate Modified: trunk/SQLObject/docs/SQLObject.txt =================================================================== --- trunk/SQLObject/docs/SQLObject.txt 2004-12-29 16:51:52 UTC (rev 503) +++ trunk/SQLObject/docs/SQLObject.txt 2004-12-29 17:02:51 UTC (rev 504) @@ -275,7 +275,20 @@ with non-database properties (there's no benefit, but it helps hide the difference between database and non-database attributes). +Lazy Updates +------------ +By default SQLObject sends an ``UPDATE`` to the database for every +attribute you set, or everytime you call ``.set()``. If you want to +avoid this many updates, add ``_lazyUpdate = True`` to your class +definition. Then updates will only be written to the database when +you call ``inst.syncUpdate()`` or ``obj.sync()``: ``.sync()`` also +refetches the data from the database, which ``.syncUpdate()`` does not +do. + +When enabled instances will have a property ``dirty``, which indicates +if there are pending updates. Inserts are still done immediately. + One-to-Many Relationships ------------------------- |