something like this?

items=[('key1','label1'), ('key2','label2')]
options=[OPTION(v,_value=k) for (k,v) in items]
keys=[k for (k,v) in items]

SELECT(*options,_name='selector',value='key1',requires=IS_IN_SET
(keys))

On Jun 8, 7:23 pm, Jose <[email protected]> wrote:
> Hello
>
> I need to fill a DropDown with values of the database, but not in a
> traditional way.
>
> db.table1.id_field1.requires = IS_IN_DB(db(db, 'table2.id',
> 'table2.field3')
>
> I want to do it manually, but I do not manage deal well which are
> SELECT's parameters
>
> I saw this:
>
> SELECT('yes','no',_name='selector',value='yes',requires=IS_IN_SET
> (['yes','no']))
>
> The key values will be in a list and will have this form:
>
> [ ' 1; 1 ', ' 2; 1 '...]
> It is a compound key that later I am going to separate to insert in
> the fields correpondientes.
>
> Concluding, I am going to have a list with with the key values and
> other one with the values to show.
>
> How do I use these lists in the object SELECT?
>
> Regards Jose
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to