<dtml-in "foo" sort=akey> is really handy as everyone knows.
<dtml-in "foo" sort=akey1,akey2,akey3>
Please add a comment to the wiki to let me know how you go. If it proves useable, I'd suggest it eventually might be worth considering for a future release since without this patch, if you need multiple keys you have to fake them in your data which is cruel..
I haven't even tried the mapping version code and I suspect that it's unlikely to work, but, in the spirit of opensource, for those of a self destructive urge and strong stomach, here's the diff and the whole DT_In.py
This is highly experimental..PLEASE don't even think about using this unless you're willing to clean up any mess that results. All care, no responsibility.
Note that the new file has the original method renamed as osort_sequence so you can easily revert to normal operation.