On Saturday 28 July 2007 06:13:39 Christopher Armstrong wrote: > Another interesting technique is using default=AutoReload, so that the > ID will automatically be loaded from the database when a value is not > currently available. > > class Account(Storm): > __storm_table__ = "account" > > id = Int(primary=True, default=AutoReload) > > account = store.add(Account()) > print account.id # should be an actual number > > Note that this *doesn't* reload the value from the database on every > attribute access, so don't worry about that. The default= argument > only applies when no value is yet available.
Very cool! Tim -- storm mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/storm
