Metadata lists need api option to "order_by" returned results
First, there are 3 endpoints that return lists of metadata in geomagio/api/secure/metadata.py:
- [/ws/secure]/metadata - returns non-history metadata based on column queries;
- [/ws/secure]/metadata/history - returns history metadata based on column queries;
- [/ws/secure]/metadata/{metadata_id}/history - returns the current metadata_id, plus the full history of that metadata.
As of this issue creation, only the 3rd explicitly sorts the results, and it does so in a manner that only really makes sense for a list of related metadata histories (it uses the updated_time
column).
We probably should:
-
add options to geomagio/api/secure/metadata.py (and maybe geomagio/api/ws/metadata.py) to specify order_by
for returned lists -
specify default order_by
to other methods defined in geomagio/api/db/MetadataDatabaseFactory.py that return lists of metadata (?) -
make corresponding changes to the MetadataFactory
@ehunter, would you add/change anything to this issue?