Today I was struggling with why the following did not work for me in one of 
my tables:

Field('modified_on', 'datetime', default=request.now, update=request.now)


After some fiddling I found that writable=False must be explicitly added for 
this to work properly.


--> Field('modified_on', 'datetime', default=request.now, update=request.now, 
writable=False)


I understand that it does not make sense to have writable=True when you added 
update=... to a field (same counts if you use compute), but I believe it does 
make sense to add this in the documentation (in the DAL chapter describing the 
Field constructor) - just so other people don't waste time figuring this out.


Best regards,

Tom.

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to