Hi Anthony,
Sorry for the delay.. The code as you show above looks indeed much the
same as my code.
I already discovered before that restarting Web2py server after module
changes is a good idea. So this is not the solution for my problem.
Your code works fine for me as well. After removing the db
Hmm, the following test code works for me without any db.commit:
*In /controllers/default.py:*
def index():
db.define_table('time', Field('time'))
from mymodule import DbTest
test = DbTest(db)
return dict(results=db(db.time).select())
*In /views/default/index.html:*
{{extend 'la
On Feb 24, 6:38 pm, Anthony wrote:
> On Friday, February 24, 2012 12:24:03 PM UTC-5, JaapP wrote:
>
> > Hi Wikus,
>
> > Thanks a lot!
> > Adding a db.commit() after an insert causes the database to be updated.
>
> The db.commit() shouldn't be needed. Can you show some code?
>
> Anthony
This is
On Friday, February 24, 2012 12:24:03 PM UTC-5, JaapP wrote:
>
> Hi Wikus,
>
> Thanks a lot!
> Adding a db.commit() after an insert causes the database to be updated.
>
The db.commit() shouldn't be needed. Can you show some code?
Anthony
Hi Wikus,
Thanks a lot!
Adding a db.commit() after an insert causes the database to be updated.
Bye,
Jaap
On Friday, February 24, 2012 12:13:20 PM UTC-5, Wikus van de Merwe wrote:
>
> The code in controllers is wrapped in web2py with a try except clause that
> automatically commits or rolls back the changes to db. I believe this is
> not the case for modules and an explicit commit is needed there. Tr
The code in controllers is wrapped in web2py with a try except clause that
automatically commits or rolls back the changes to db. I believe this is
not the case for modules and an explicit commit is needed there. Try to add
"db.commit" to your module code.
That should work fine. You don't have to use classes in modules.
Anthony
On Friday, February 24, 2012 11:45:13 AM UTC-5, Cliff wrote:
>
> Interesting. I wonder why my modules are working when I just pass the
> db to the functions within them?
>
> On 1.99.2 I have something like this working.
Interesting. I wonder why my modules are working when I just pass the
db to the functions within them?
On 1.99.2 I have something like this working.
mymodule.py contains no classes, just some functions. One looks like
this:
def myfunction(db, request, session, some_value):
query = db[request
9 matches
Mail list logo