Re: [web2py] Write in database from modules

2015-12-04 Thread Yoel Benitez Fonseca
In module1.py: def myfunction(var1=2): db = current.db db.table1.insert(F1=var1) db.commit() # if this call is not a part of a HTTP request return 2015-12-04 9:39 GMT-05:00, Aydin S : > This might be asked before and I already found a similar question in here: > https://groups.g

[web2py] Write in database from modules

2015-12-04 Thread Aydin S
This might be asked before and I already found a similar question in here: https://groups.google.com/forum/#!topic/web2py/0k0Fvw6fmb8 but this seemed a bit confusing. How to write on database from within a module? I have a table defined in db.py (model) as follows: db.define_table('Table1', F