Skip to content

Commit

Permalink
Merge pull request #7 from neogeo-technologies/redmine-issues/14001
Browse files Browse the repository at this point in the history
Fix datastore sort by date
  • Loading branch information
m431m authored Aug 18, 2022
2 parents f7e7668 + a84d207 commit 4913bc8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ckanext/datastore/backend/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -1719,15 +1719,14 @@ def datastore_search(self, context, data_dict, fields_types, query_dict):

select_cols = []
records_format = data_dict.get(u'records_format')
json_values = records_format in (u'objects', u'lists')
for field_id in field_ids:
fmt = u'to_json({0})' if records_format == u'lists' else u'{0}'
typ = fields_types.get(field_id)
if typ == u'nested':
fmt = u'({0}).json'
elif typ == u'timestamp':
fmt = u"to_char({0}, 'YYYY-MM-DD\"T\"HH24:MI:SS')"
if json_values:
if records_format == u'lists':
fmt = u"to_json({0})".format(fmt)
elif typ.startswith(u'_') or typ.endswith(u'[]'):
fmt = u'array_to_json({0})'
Expand Down

0 comments on commit 4913bc8

Please sign in to comment.