SortedDict

djagno.utils.datastructures.SortedDict

>>> from django.utils.datastructures import SortedDict
>>> d = SortedDict()
>>> d['hoge'] = 'fuga'
>>> d
{'hoge': 'fuga'}
>>> d['foo'] = 'bar'
>>> d
{'hoge': 'fuga', 'foo': 'bar'}
>>> d.keyOrder
['hoge', 'foo']
>>> d.keyOrder.sort()
>>> d.keyOrder
['foo', 'hoge']
>>> d
{'foo': 'bar', 'hoge': 'fuga'}