http://www.saltycrane.com/blog/2008/01/how-to-use-args-and-kwargs-in-python/

On Wednesday, 29 August 2012 12:14:09 UTC-5, Annet wrote:
>
> Hi Anthony,
>
> Thanks for your reply. I am not sure I completely understand **attributes 
> does. Is it documented somewhere?
>
> Will this work:
>
> attributes = 
> dict(type='datetime',default=request.now,requires=IS_DATETIME(format='%Y-%m-%d
>  
> %H:%M:%S'),writable=False,readable=False,represent = lambda v, row: 
> v.strftime('%d/%m/%Y %H:%M:%S') if v else '')
>
> db.define_table('node',
>     ...
>     Field('createdOn',**attributes),
>     Field('modifiedOn',default=request.now,**attributes),
>     ...)
>
> db.define_table('organization',
>     ...
>     Field('createdOn',**attributes),
>     Field('modifiedOn',default=request.now,**attributes),
>     ....)
>
> db.define_table('person',
>     ...
>     Field('createdOn',**attributes),
>     Field('modifiedOn',default=request.now,**attributes),
>     ....)
>
>
> Kind regards,
>
> Annet
>

-- 



Reply via email to