On Saturday, October 5, 2013 8:04:54 PM UTC-4, User wrote:

> I do have writable=False and I understand that will work for normal 
> forms, but it still shows up in appadmin
>

Yes, appadmin ignores the writable attribute. Is it really important to 
distinguish between the time the form is loaded and the time of the insert? 
If so, something like this might work (not tested):

standard_fields = db.Table(db, 'standard_fields',
    Field('created_on', 'datetime', default=request.now))
if request.controller == 'appadmin':
    standard_fields.created_on.compute = lambda row: request.now

I believe appadmin will not show a computed field, so the above should 
compute the value at time of insert.

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/groups/opt_out.

Reply via email to