[web2py] default values in a form

2014-03-24 Thread Daniel McBrearty
In my app I have this: cf = db.contacts.fields form = FORM("Field:",SELECT(cf, _name="field", requires = IS_IN_SET( cf ), _value="last_name"), "(Exact match?)", INPUT( _type="checkbox", _name = 'exact', _value = True), "Search for (required):", INPUT( _typ

Re: [web2py] Default Values.

2010-12-26 Thread Branko Vukelić
Oops. Correction: str(field.type)[:10] 2010/12/27 Branko Vukelić : > Have you tried ``str(field.type[:10])``? Just a wild guess. I think > just saying ``field.type[:10]`` would actually return a class > instance, not a string. > > On Mon, Dec 27, 2010 at 2:05 AM, David J. wrote: >> Thanks fo

Re: [web2py] Default Values.

2010-12-26 Thread Branko Vukelić
Have you tried ``str(field.type[:10])``? Just a wild guess. I think just saying ``field.type[:10]`` would actually return a class instance, not a string. On Mon, Dec 27, 2010 at 2:05 AM, David J. wrote: > Thanks for the Tips; > > Does this have sqlite have some sort of limitations? > > I seem to

Re: [web2py] Default Values.

2010-12-26 Thread David J.
Thanks for the Tips; Does this have sqlite have some sort of limitations? I seem to get this exception; Traceback (most recent call last): File "/Users/book/Desktop/python-projects/web2py/gluon/restricted.py", line 188, in restricted exec ccode in environment File "/Users/book/Deskt

Re: [web2py] Default Values.

2010-12-26 Thread pbreit
Definitely suggest running through chapter 3 of the book (and all chapters if possible).

Re: [web2py] Default Values.

2010-12-26 Thread David J.
Thanks; just what I was looking for. On 12/26/10 6:19 PM, Bruno Rocha wrote: Field ('created_on','datetime',default=request .now), Field

Re: [web2py] Default Values.

2010-12-26 Thread Bruno Rocha
Field ('created_on', 'datetime', default=request .now), Field ('created_by', db.auth_user, default=auth.user_id), Field

[web2py] Default Values.

2010-12-26 Thread David J.
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?

[web2py] default values in options widget

2010-12-21 Thread max
Hi, is it possible to set a default value to a widgets.options.widget? model: db = DAL('sqlite://storage.sqlite') db.define_table('mytable', Field('options_1', 'text', widget = SQLFORM.widgets.options.widget ), Field('options_2', 'text', widget = SQLFORM.widgets.options.widget )) db.mytab