Thanks; just what I was looking for.


On 12/26/10 6:19 PM, Bruno Rocha wrote:
     Field  
<http://web2py.com/book/default/docstring/Field>('created_on','datetime',default=request
  <http://web2py.com/book/default/docstring/request>.now),

     Field  
<http://web2py.com/book/default/docstring/Field>('created_by',db.auth_user,default=auth.user_id),

     Field  
<http://web2py.com/book/default/docstring/Field>('updated_on','datetime',update=request
  <http://web2py.com/book/default/docstring/request>.now),

     Field  
<http://web2py.com/book/default/docstring/Field>('updated_by',db.auth_user,update=auth.user_id))

http://web2py.com/book/default/chapter/06#Table-Inheritance



2010/12/26 David J. <da...@styleflare.com <mailto:da...@styleflare.com>>

    How do  I specify Default DB values;

    ie: I have a db field created_at which is datetime and should be a
    timestamp of when the user was created.

    Normally in mysql; we use "created_at timestamp default now()"
    where do I specify this default value? Or do I specify it when I
    create the object?


    Thanks.




--

Bruno Rocha
http://about.me/rochacbruno/bio

Reply via email to