On Sep 6, 4:16 pm, mdipierro <[email protected]> wrote:
> If you want to translate the actual options than you must use
> IS_IN_SET instead of IS_IN_DB.

THis is how I do this:
pr_person_gender_opts = {
    1:T('unknown'),
    2:T('female'),
    3:T('male')
    }

db.Field('opt_pr_gender','integer',requires = IS_IN_SET
(pr_person_gender_opts))

This way can do programmatic things based on the options' index no
matter what the actual value of the field.

The only issue is that then new options can't be added dynamically
unless operating in a T3-style mode or this idea:
- separate out dropdowns which need editing to a separate file
- provide a UI which reads/writes to just this file (bad for
clustering, though)

Would be great to hear how other people handle this scenario...

F
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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