Re: How to lazy-sort a list of translation strings alphabetically

2010-01-26 Thread Andreas Pfrengle
On 25 Jan., 20:36, Matthias Kestenholz wrote: > Alternatively, you could write your own Field or > Widget which implements the sorting -- it's not that hard. I was just starting to write "It doesn't work" when I found this here: http://www.djangosnippets.org/snippets/1767/ class LazyChoiceField(

How to lazy-sort a list of translation strings alphabetically

2010-01-17 Thread Andreas Pfrengle
For a multilingual project, I have a ChoiceField and want to display the choices in alphabetical order - according to the current language. Example: choices = ((1, _('Some choice')), (2, _('Another choice')), (3, _('One more choice'))) In English it should be ordered 'Another choice', 'One more ch