Skip to content

Entering more than one sort order condition in finds #25

@bagheraa

Description

@bagheraa

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions