[web2py] Mistake in the web2py book

2012-08-07 Thread Remco K
Hi,

I found a little mistake in the Web2Py-book but i dont know if this is the 
right place to report these things.

Anyway:

I was reading about using the scheduler when i saw this:

completed_runs = db(db.scheduler_run.status='COMPLETED').select()

Which gives the error:

SyntaxError: keyword can't be an expression

Because this must be (dubble ==):

completed_runs = db(db.scheduler_run.status=='COMPLETED').select()

Link: 
http://web2py.com/books/default/chapter/29/4?search=scheduler#Scheduler-%28experimental%29

Regards,
Remco

-- 





[web2py] Mistake in the Web2Py book?

2012-07-07 Thread Remco K
Hi,

I was reading about crud.archive in the online Web2Py book, when i noticed 
the following:

auth.archive does not timestamp the stored record unless your original 
table has timestamp fields, for example:

 db.define_table('mytable',
 Field('created_on','datetime',
 default=request.now,update=request.now,writable=False),
 Field('created_by',auth.user,
 default=auth.user_id,update=auth.user_id,writable=False),


I tried to use this in my own case and came up an error: 

TypeError: unhashable type: 'Storage'

After i changed:

Field('created_by',auth.user,

To:

Field('created_by',db.auth_user,

I got this working.

So, I was wondering if this is a mistake or is it just me who doesn't 
understand this? :-)

Remco