Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entering more than one sort order condition in finds #25

Open
bagheraa opened this issue Dec 11, 2017 · 0 comments
Open

Entering more than one sort order condition in finds #25

bagheraa opened this issue Dec 11, 2017 · 0 comments

Comments

@bagheraa
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant