[web2py] Re: list:string type field is empty value on edit page

2013-04-05 Thread Massimo Di Pierro
No it is not. Something in the code must be resetting it. On Thursday, 4 April 2013 22:13:25 UTC-5, 黄祥 wrote: > > hi, > > is it normal for list:string type field is empty when on editing page? > > e.g. > db.define_table('contact', > *Field('salutation'),* > Field('first_name'), > Field

[web2py] Re: list:string type field is empty value on edit page

2013-04-05 Thread 黄祥
is it related to the other field constructor, like required, label, etc? and for controller i'm using grid. *default.py* @auth.requires_login() def contact(): grid=SQLFORM.grid(db.contact, user_signature=False) return locals() *db_wizard.py* # create table : contact db.define_table('cont

[web2py] Re: list:string type field is empty value on edit page

2013-04-07 Thread 黄祥
i've already start testing using the simple table (start from scratch) but got the same result. here is my conclusion, please correct me if i'm wrong : - if you combine list:string field with IS_IN_SET validator, in form edit you will receive blank value in drop down, not the existing value that

[web2py] Re: list:string type field is empty value on edit page

2013-04-08 Thread Massimo Di Pierro
db.define_table('gender', Field('gender', 'list:string'), format='%(gender)s') db.gender.gender.requires=IS_IN_SET(['Male', 'Female']) should be db.define_table('gender', Field('gender', 'list:string'), format='%(gender)s') db.gender.gender.requires=IS_IN_SET(['Male', 'Female'],m

[web2py] Re: list:string type field is empty value on edit page

2013-04-09 Thread 黄祥
yeah, my mistake. thanks for correct me -- --- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https

[web2py] Re: list:string type field is empty value on edit page

2015-05-04 Thread Ben Lawrence
Thanks for your work around. I see this too. It seems more convenient to use: Field('gender','string',requires=IS_IN_SET(('Male', 'Female'))) as this will keep the default when in edit. On Sunday, April 7, 2013 at 10:00:28 PM UTC-7, 黄祥 wrote: > > i've already start testing using the simple t