Matt Good wrote:
>
> The option groups sound like a good idea.  The dict implementation seems
> easy to use, but unfortunately you lose all control over the ordering of
> the groups and can't have options without a group.  If you wanted to
> keep the options more structured you could use a hybrid solution:
>
> options=[(None, 'Please choose an option'),
>          {'Dynamic Languages':
>           [(1, "Python"),
>            (2, "Ruby")]},
>          {'Others':
>           [(3, "Java"),
>            (4, "C++")]}]
>
> If you wanted to also allow multi-keyed dicts of option groups sorting
> by the key would keep them from appearing in totally random order.
>

Hi Matt,

Thanks for pointing this out, your right indeed!
I forgot that a dict doesn't preserve the order (sorry guys) (any news
in the python world regarding this? I can't see how maintaining the
order could ever hurt, while mixing it sometimes hurts, WidgetsList...
:-().

Your hybrid solution looks good but probably requires too much
verbosity, for today I'm stopping here, let's see what other thinks, to
recap:

1) My solution n°1

2) Matt solution

vote please! ;-)

Ciao
Michele


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to turbogears@googlegroups.com
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