On Fri, 2009-06-12 at 04:48 +0700, Yuri Baburov wrote: > Hi Tom, > > SortedDict(yourdict) is a hard thing and takes a lot of tinkering? > don't you have python 2.4 to use sorted(dict.iteritems())? > can't write your own python function to do this in your views side? > > next, |dictsort:"0" is working for at least two years and is pretty > stable functionality. > even if it will suddenly stop working -- you can take any dictsort > implementation and put it to your templatetags folder. is it not > acceptable? > > next, documenting issue. please add a trac issue to document this > behavior, suggest your documentation. it's working well, people is > using it, it's listed at some recipes blogs, no important related bugs > found. why should one attempt to remove or change this feature? > > you seems to be very curious about a merely meaningless question. of > course nobody knows about it a lot, nobody cares a lot, and of course > by the nature of group discussion nobody is answering.
Hi all (replying to all followups in one, to finish off the thread). The main reason I didn't want to use SortedDict is that these structures come from a complex data structure that a) doesn't know about a django, and b) doesn't need to be sorted. It seemed wrong, and to break encapsulation, to couple this module to django or to rework it's data structures in order for it to be displayed in a template. The suggestion to take the dictsort filter aside to ensure it continues working is also a good one, thanks. I did consider raising a documentation trac issue instead, saying it was an undocumented feature. I actually thought this way would be less fuss, and less distracting than a non-bug issue being raised during the 1.1 release. To be honest, I'm surprised this caused as much fuss. I would have thought it a pretty common use case, wanting to iterate through a dictionary, sorted by it's keys. I'm surprised django has no way to do this without using undocumented features. Cheers Tom --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" 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/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
