Re: [web2py] Model file variable scope

2010-08-18 Thread Mr admin
Note to self -- use Field because SQLField is deprecated


On Tue, Aug 17, 2010 at 4:46 PM, NetAdmin  wrote:

> in gluon/tools.py, I'm trying to modify the register() function
> to save request.vars.get('last_name', None ) to a table defined in
> db.py as
> db.define_table('tbextra',
>  SQLField('lastn', 'string', length = 15 )
> )
> but tools.py does not recognize the db part of  db.tbextra.lastn
> I thought variables in the model files were global.
>
> What am I doing wrong?
>
> Thanks


[web2py] Model file variable scope

2010-08-17 Thread NetAdmin
in gluon/tools.py, I'm trying to modify the register() function
to save request.vars.get('last_name', None ) to a table defined in
db.py as
db.define_table('tbextra',
  SQLField('lastn', 'string', length = 15 )
)
but tools.py does not recognize the db part of  db.tbextra.lastn
I thought variables in the model files were global.

What am I doing wrong?

Thanks