-
Notifications
You must be signed in to change notification settings - Fork 36
Description
When we want to order the records return by a find() or findAll() commands, the specified dictionary given in the SORT={'field1':'order', 'field2':'order'} argument does not work, as the members of a dictionary are given in random order in python.
I have tried with SORT=OrderedDict([('field1', 'order'), ('field2', 'order')]) from the collections module, and it works fine, as the sequence of the defined fields in the dictionary is preserved.
Nevertheless, in other database lybraries, the common way of specifiyng order conditions is a list of (field, order) tuples:
SORT=[('field1', 'order'), ('field2', 'order')].
Whether you ar going to implement this last option or left things as they are now and use an OrderedDict, this must be reflected in the documentation.