[web2py] Re: How to set default country in dropdown list

2016-02-16 Thread Dave S
On Tuesday, February 16, 2016 at 3:51:47 PM UTC-8, Winter Kryz wrote: > > > > > I created a module Countries.py with all the country names, imported into > my model db.py and > > from applications.Egressum.modules. > countries import * > ... > Field ('countries', requires =

[web2py] Re: How to set default country in dropdown list

2016-02-16 Thread Winter Kryz
I created a module Countries.py with all the country names, imported into my model db.py and from applications.Egressum.modules. countries import * ... Field ('countries', requires = IS_IN_SET(COUNTRIES), default='United States'), then when I go to execute it, I get the following error

[web2py] Re: How to set default country in dropdown list

2016-02-11 Thread Winter Kryz
I created a module Countries.py with all the country names, imported into my model db.py and Field ('countries', requires = IS_IN_SET(COUNTRIES), default='United States'), then when I go to execute it, I get the following error (1025, "Error on rename of

[web2py] Re: How to set default country in dropdown list

2016-02-10 Thread Massimo Di Pierro
I attached a file with a list of all countries On Tuesday, 9 February 2016 19:59:41 UTC-6, Dave S wrote: > > > > On Tuesday, February 9, 2016 at 5:10:03 PM UTC-8, Winter Kryz wrote: >> >> Thanks for the answers >> I tried what xmarx said but it didn't work >> > > What errors did you get? > > >

[web2py] Re: How to set default country in dropdown list

2016-02-10 Thread Dave S
On Wednesday, February 10, 2016 at 4:57:58 PM UTC-8, Winter Kryz wrote: > > > I tried > Field('nationality', requires=IS_IN_SET(nationalities), default='United > States') > > but it gives me the following error > > name 'nationalities' is not defined > You need to define the set

[web2py] Re: How to set default country in dropdown list

2016-02-10 Thread Winter Kryz
I tried Field('nationality', requires=IS_IN_SET(nationalities), default='United States') but it gives me the following error name 'nationalities' is not defined I have to mention that I have already load all the nationalities names into a table called 'Nationalities' so what I need is

[web2py] Re: How to set default country in dropdown list

2016-02-09 Thread Massimo Di Pierro
I would not make this a reference fields. I would make it a IS_IN_SET(...) field. This is because possible nationalities do not change very often and are definitively not changed by the user. On Tuesday, 9 February 2016 05:34:29 UTC-6, xmarx wrote: > > db.define_table('Person', >

[web2py] Re: How to set default country in dropdown list

2016-02-09 Thread xmarx
db.define_table('Person', Field('last_name', 'string'), Field('name', 'string'), Field('telephone', 'string'), Field('email', 'string'), Field('nationality','reference Nationalities',default=1),

[web2py] Re: How to set default country in dropdown list

2016-02-09 Thread Winter Kryz
Thanks for the answers I tried what xmarx said but it didn't work How would I use it with IS_IN_SET? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You

[web2py] Re: How to set default country in dropdown list

2016-02-09 Thread Dave S
On Tuesday, February 9, 2016 at 5:10:03 PM UTC-8, Winter Kryz wrote: > > Thanks for the answers > I tried what xmarx said but it didn't work > What errors did you get? > How would I use it with IS_IN_SET? > > nationalities=['United States',"United Kingdom","France",'Germany']