The syntax may be correct per the manual, but IS_IN_DB tells Postgres to 
create a foreign key constraint on the field.  If you look at the tables 
with psql or pgadmin you will see this is so.

A foreign key constraint is always on the primary key of the foreign table. 
 It has to be this way to guarantee uniqueness.

This will work:

countries = [r.countryname for r in 
db(somequery).select(db.countries.countryname)]

db.testing.origin.requires = IS_IN_SET(countries)



On Thursday, March 21, 2013 3:36:51 PM UTC-4, Alan Etkin wrote:
>
> > there is no string validator, i just use IS_IN_DB to create drop down 
> widget
>
> Yes, sorry, I checked the api and it seems you are using the correct 
> syntax.
>
> Does it work using  IS_IN_DB (db, db.countries.country_name) instead? 
>

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to