(Cleaning up some flagged items I've been meaning to respond to...) On Tue, 2007-05-29 at 03:56 -0500, James Bennett wrote: > I noticed a patch sitting on #4412 tonight which seems interesting but > definitely needs a decision; the idea is that, rather than > implementing a separate widget or set of widgets to handle grouping of > options (via the HTML "optgroup" element), the Select and > SelectMultiple widgets should look at the structure of 'choices -- if > it has a nested structure of grouped choices, those should translate > into optgroups in the rendered widget. > > Personally, I kind of like the simplicity of the approach and the fact > that it handles this use case without needlessly multiplying widgets, > so I'd give it a tentative +1.
Aah... the old nested tuples as way of creating an ordered dictionary approach. Good value in languages that are built around S-expressions, but not something you necessarily want to read when programming Python. Alternatives are possible as bad, though (unless we insist that SortedDict is used there?). My only minor concern is that we are letting ourselves in for a large number of queries asking why it doesn't work with models. I think it's a *good* thing model fields still expect a sequence of pairs -- putting presentation into the data representation is uncool -- but that won't stop people trying to extrapolate. That feature should be documented so that it can be properly ignored. I'm probably between +0 and +1 here, I guess. It shouldn't be too harmful, there isn't really any existing support for optgroups, so people wanting to use them would have to write their own Select derivative, and they are useful for some kinds of lists. Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---