Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ogcapi - records] use dates related to records only #1048

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions pycsw/ogc/api/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -1165,17 +1165,21 @@ def record2json(record, url, collection, mode='ogcapi-records'):
record.otherconstraints = [record.otherconstraints]
record_dict['properties']['license'] = ", ".join(record.otherconstraints)

record_dict['properties']['updated'] = record.insert_date

if record.type:
record_dict['properties']['type'] = record.type

if record.date_creation:
record_dict['properties']['created'] = record.date_creation
record_dict['properties']['updated'] = record.insert_date # this is always populated

if record.date: # date is used in some schema's (DC)
record_dict['properties']['updated'] = record.date

if record.date_modified:
if record.date_modified: # used in ISO
record_dict['properties']['updated'] = record.date_modified

# pycsw does not capture date of record creation, use updated
record_dict['properties']['created'] = record_dict['properties']['updated']

if record.language:
record_dict['properties']['language'] = record.language

Expand Down
Loading