[storm] referenceset and lazy attributes
Gustavo Niemeyer
gustavo at niemeyer.net
Mon Sep 3 14:32:20 BST 2007
> I think a attribute-group implementation would be the best where we can
> define which attributes are selected together. So in the example below
> url and title would be fetched together.
>
> class A(object):
>
> url = Unicode(group='smalltexts')
> title = Unicode(group='smalltexts')
> toc = Unicode(group='hugetexgts')
One issue with that is that if you load 'toc', it wouldn't retrieve 'url'
and 'title', which are most probably wanted. I wonder if we should just
stick with a simpler implementation. E.g.:
class A(object):
url = Unicode()
title = Unicode()
toc = Unicode(lazy=False)
data = Unicode(lazy=False)
Can you imagine a use case where this wouldn't be enough?
Also, I wonder if 'toc' and 'data' should be loaded together, or if they
should be fetched individually on demand.
--
Gustavo Niemeyer
http://niemeyer.net
More information about the storm
mailing list