- changed title to add "deferred property" loader (half done - need 'group' + docs)
add "deferred property" loader (half done - need 'group' + docs)
a lazy loader right now only applies to a second table that is related to a primary table. we need a lazy loader that applies to a subset of the columns within a single table.
when you load an object from the DB, all the columns of the table are loaded into the new object instance unconditionally. for situations where it is wasteful to load all the columns into memory every time, create a new kind of property, the "deferred column", that is not selected by default when an object is loaded. the property contains a callable which when refrenced, triggers a load of all the "deferred" columns.
as a bonus, make it so that if an object is loaded, modified, and saved, all without touching any of the "deferred" columns, they remain unloaded from the database even after save.
Comments (6)
-
reporter -
reporter also, add mapper options for controlling this property:
defer(colname, group=None) - passed to mapper.options to convert a column proeprty to a deferred column property. optional group indicates the group of deferred properties to be loaded simultaneouly
undefer(colname) - passed to mapper.options to convert a deferred column property to a non-deferred column property
-
reporter group option added in changeset:733. still need to do the options.
-
reporter - changed status to resolved
and its done at last in changeset:735
-
reporter oh yeah, and did the "dont load unloaded properties upon save" thing in 736.
-
reporter - removed milestone
Removing milestone: 0.2.0 (automated comment)
- Log in to comment
first version added in changeset:730.
this deferred-loads a single column. multiple deferred loaders can be specified, but they are all separate.
so next step, add a "group" option to the deferred loader so that multiple deferred loaders can all kick off from the same group.
also add to documentation.