[web2py] Re: field attributes outside field definition.

2012-08-30 Thread Annet
Massimo and Anthony, Thanks for your replies. Kind regards, Annet --

[web2py] Re: field attributes outside field definition.

2012-08-29 Thread Anthony
On Wednesday, August 29, 2012 1:14:09 PM UTC-4, Annet wrote: > > Hi Anthony, > > Thanks for your reply. I am not sure I completely understand **attributes > does. Is it documented somewhere? > That's not web2py specific -- it's just standard Python. It's a way of passing a dictionary to a functi

[web2py] Re: field attributes outside field definition.

2012-08-29 Thread Massimo Di Pierro
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: > > attribut

[web2py] Re: field attributes outside field definition.

2012-08-29 Thread Annet
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, ro

[web2py] Re: field attributes outside field definition.

2012-08-29 Thread Anthony
attributes = dict(type='datetime', default=request.now, ...) ... Field('createdOn', **attributes) Anthony On Wednesday, August 29, 2012 2:17:57 AM UTC-4, Annet wrote: > > In my models I have the following table definition: > > db.define_table('node', > Field('computedName',length=128), >