[storm] Autoreload- possible answer

Gustavo Niemeyer gustavo at niemeyer.net
Mon Oct 15 13:44:09 BST 2007


Greetings,

akira wrote:
> I think I have it Gustavo, I decalerd the id field as autoreload:
> 
> class User(object):
>    __storm_table__ = "users"
>    id                    = Int(primary=True, default=AutoReload)
>    group_type       = Unicode()
> 
> user  = User()
> 
> then before I save to the othere tables I do this
> 
> otherObj.otherfield = user.id
> 
> 
> Do I have to fear rece conditions or the id being stale before I auto
> reload it? What would be the best solution?

Probably not.  You may also use References rather than assigning ids
manually.

-- 
Gustavo Niemeyer
http://niemeyer.net



More information about the storm mailing list