[storm] Lazy value loading

Gustavo Niemeyer gustavo at niemeyer.net
Fri Oct 24 13:42:21 BST 2008


Hey Adrian,

> Unfortunately this produces query which loads all fields, including
> 'contents', which is unnecessary and takes a lot of time. I'd like to
> make the 'contents' field lazy, i.e.
>
>  contents = Unicode(lazy=True)    # (in Book class definition)
>
> so that it would load only after I access this field (i.e.
> books[0].contents). Is it possible?

Unfortunately that feature isn't available out of the box yet, but
it's in our TODO list, and will get done at some point.  Meanwhile,
you cant try the way Thomas suggested.

-- 
Gustavo Niemeyer
http://niemeyer.net



More information about the storm mailing list