On 10/24/06, Alberto Valverde <[EMAIL PROTECTED]> wrote:
> You can also initialize your select field passing a callable as the
> options parameter which can return fresh options for each request:
>
> def players():
>         return [(p.id, p.name) for p in Player.select()]
>
> select_field = SingleSelectField("goalie", options=players)


As an aside, you might also find it more succinct to use an anonymous
function for this:

select_field = SingleSelectField("goalie", options = lambda: [(p.id,
p.name) for p in Player.select()])
-- 
Tim Lesher <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to