You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
When we want to order the records return by a
find()
orfindAll()
commands, the specified dictionary given in theSORT={'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.
The text was updated successfully, but these errors were encountered: