Rather than relying on an OrderedDict, and having to do this and make it keep track of order separately for each user, could it just be a regular dictionary, and then pass in a single list with the order of the keys to use to lookup into each user dictionary? I think we looked into how easy that would be in Django templates recently: was there a good way, or is OrderedDict the best?