> > *modules/test.py* > from gluon import * > > def insert_table_event(time_stamp, client_ip, user_id, origin, > description): > current.db.auth_event.insert(time_stamp = time_stamp, > client_ip = client_ip, > user_id = user_id, > origin = origin, > description = description) >
Note, current.db will not work unless you add the "db" attribute from within a model or controller. For example, in the db.py model file: from gluon import current current.db = db Alternatively, you can access the db object (as well as any object available in the web2py global environment) via the current.globalenv dictionary (e.g., current.globalenv['db']). Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

