Hi,
If you want to use OrderedDict Perhaps you can store the information in the DB explicitly as a list of tuples?
d = OrderedDict({‘blub’: 1, ‘blob’: 2}) → OrderedDict([(‘blub’, 1), (‘blob’, 2)])
l = list(d.items()) → [(‘blub’, 1), (‘blob’, 2)]
then fill the table with ‘l’reverse:
d = OrderedDict(l)
OrderedDict([(‘blub’, 1), (‘blob’, 2)])