Open GoogleCodeExporter opened 8 years ago
Sorry, title should not mention sort order.
Original comment by esiot...@gmail.com
on 15 Dec 2010 at 7:50
The problem is in this two lines. Key-value pairs in a python dictionary are
unordered by definition (a dictionary is a set, not a sequential container). So
precedence in order criterias is not guarantied. To solve the bug, simply
change this lines in FMServer.py by:
for i in range(0, len(SORT), 2):
self._addSortParam(SORT[i], SORT[i+1])
and then in your code, write the find as a list of pairs field operation:
doFind(..., SORT['field1', '<', 'field2', '<'])
I hope this can help.
Original comment by e.marti....@gmail.com
on 10 Dec 2013 at 9:18
Thanks for the reply, but it is almost 3 years too late ;) Maybe it will help
someone else. I decided I could not rely on pyfilemaker in production and made
other arrangements.
Original comment by esiot...@gmail.com
on 10 Dec 2013 at 3:56
There is a way of solving this problem without modifying FMServer.py.
All you need is the OrderedDict class that is in the collections module. In
your code, you must write:
#from collections import OdreredDict as odict
...
doFind(..., SORT=odict([('field1', '<'), ('field2', '>'), ('field3', '>')]))
This works very fine now.
Original comment by e.marti....@gmail.com
on 19 Aug 2014 at 9:26
Original issue reported on code.google.com by
esiot...@gmail.com
on 15 Dec 2010 at 7:49