Re: [web2py] Help me get a better feel for efficient code

2012-06-07 Thread Jonathan Lundell
On Jun 7, 2012, at 6:12 PM, Cliff Kachinske wrote: > Does that mean there's only one instance of current for a running instance of > Web2py? So if I do current.db, it could overwrite a current.db assigned in > an earlier request? No, it's unique to the current request (that's why it's called cu

Re: [web2py] Help me get a better feel for efficient code

2012-06-07 Thread Cliff Kachinske
Thanks, Jonathon, Does that mean there's only one instance of current for a running instance of Web2py? So if I do current.db, it could overwrite a current.db assigned in an earlier request? On Thursday, June 7, 2012 7:07:35 PM UTC-4, Jonathan Lundell wrote: > > On Jun 7, 2012, at 2:42 PM, Cli

Re: [web2py] Help me get a better feel for efficient code

2012-06-07 Thread Jonathan Lundell
On Jun 7, 2012, at 2:42 PM, Cliff Kachinske wrote: > I don't have a good feel for the most efficient way to, for example, pass the > db to a class method. I can think of three ways. > > - Pass it in when you call the method. > - Pass it in when you initialize the class > - Import current, do som

[web2py] Help me get a better feel for efficient code

2012-06-07 Thread Cliff Kachinske
I'm just starting to use modules with classes for code commonality. I don't have a good feel for the most efficient way to, for example, pass the db to a class method. I can think of three ways. - Pass it in when you call the method. - Pass it in when you initialize the class - Import current,