Closed wlorenzetti closed 2 months ago
Closes: #806
Apply the orderign URl parameter on field set by fformatter parameter.
fformatter
Without ordering parameter:
ordering
http://localhost:8006/vector/api/data/qdjango/336/buildings_2f43dc1d_6725_42d2_a09b_dd446220104a/?fformatter=address&format=json
"data": [ [ "A101", "Via Sallustio Bandini" ], [ "A102", "Via Atto Vannucci" ], [ "A103", "Via Alfredo Oriani gia' Via Vecchia" ], [ "A106", "Piazza Pietro Leopoldo" ], [ "A107", "Via Ubaldo Montelatici" ], [ "A108", "Via Giandomenico Romagnosi" ], [ "B002", "Via Giovanni Lampredi" ] ]
With ordering parameter (ordering=address):
http://localhost:8006/vector/api/data/qdjango/336/buildings_2f43dc1d_6725_42d2_a09b_dd446220104a/?fformatter=address&format=json&ordering=address
"data": [ [ "A106", "Piazza Pietro Leopoldo" ], [ "A103", "Via Alfredo Oriani gia' Via Vecchia" ], [ "A102", "Via Atto Vannucci" ], [ "A108", "Via Giandomenico Romagnosi" ], [ "B002", "Via Giovanni Lampredi" ], [ "A101", "Via Sallustio Bandini" ], [ "A107", "Via Ubaldo Montelatici" ] ]
Also works with - i.e. ordering=-address fro reversing results.
-
ordering=-address
The sorting of results is made by str.sort() python function
str.sort()
Closes: #806
Apply the orderign URl parameter on field set by
fformatter
parameter.Without
ordering
parameter:With
ordering
parameter (ordering=address):http://localhost:8006/vector/api/data/qdjango/336/buildings_2f43dc1d_6725_42d2_a09b_dd446220104a/?fformatter=address&format=json&ordering=address
Also works with
-
i.e.ordering=-address
fro reversing results.IMPORTANT
The sorting of results is made by
str.sort()
python function