mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
Add UTC flag to date strings
This commit is contained in:
parent
0a9bea0740
commit
def01d474e
@ -115,9 +115,9 @@ def corpus_analysis_get_meta_data(corpus_id):
|
|||||||
metadata = {}
|
metadata = {}
|
||||||
metadata['corpus_name'] = db_corpus.title
|
metadata['corpus_name'] = db_corpus.title
|
||||||
metadata['corpus_description'] = db_corpus.description
|
metadata['corpus_description'] = db_corpus.description
|
||||||
metadata['corpus_creation_date'] = db_corpus.creation_date.isoformat()
|
metadata['corpus_creation_date'] = db_corpus.creation_date.isoformat() + 'Z'
|
||||||
metadata['corpus_last_edited_date'] = \
|
metadata['corpus_last_edited_date'] = \
|
||||||
db_corpus.last_edited_date.isoformat()
|
db_corpus.last_edited_date.isoformat() + 'Z'
|
||||||
client = corpus_analysis_clients.get(request.sid)
|
client = corpus_analysis_clients.get(request.sid)
|
||||||
if client is None:
|
if client is None:
|
||||||
response = {'code': 424, 'desc': None, 'msg': 'Failed Dependency'}
|
response = {'code': 424, 'desc': None, 'msg': 'Failed Dependency'}
|
||||||
@ -145,7 +145,7 @@ def corpus_analysis_get_meta_data(corpus_id):
|
|||||||
for struct_attr in struct_attrs:
|
for struct_attr in struct_attrs:
|
||||||
texts_metadata[text_id][struct_attr.attrs['name'][(len(text_attr.attrs['name']) + 1):]] = struct_attr.values_by_ids(list(range(struct_attr.attrs['size'])))[text_id] # noqa
|
texts_metadata[text_id][struct_attr.attrs['name'][(len(text_attr.attrs['name']) + 1):]] = struct_attr.values_by_ids(list(range(struct_attr.attrs['size'])))[text_id] # noqa
|
||||||
metadata['corpus_all_texts'] = texts_metadata
|
metadata['corpus_all_texts'] = texts_metadata
|
||||||
metadata['corpus_analysis_date'] = datetime.utcnow().isoformat()
|
metadata['corpus_analysis_date'] = datetime.utcnow().isoformat() + 'Z'
|
||||||
metadata['corpus_cqi_py_protocol_version'] = client.api.version
|
metadata['corpus_cqi_py_protocol_version'] = client.api.version
|
||||||
metadata['corpus_cqi_py_package_version'] = cqi.__version__
|
metadata['corpus_cqi_py_package_version'] = cqi.__version__
|
||||||
# TODO: make this dynamically
|
# TODO: make this dynamically
|
||||||
|
@ -59,7 +59,7 @@ def ressource_after_update_handler(mapper, connection, ressource):
|
|||||||
# In order to be JSON serializable, DateTime attributes must be
|
# In order to be JSON serializable, DateTime attributes must be
|
||||||
# converted to a string
|
# converted to a string
|
||||||
if isinstance(new_value, datetime):
|
if isinstance(new_value, datetime):
|
||||||
new_value = new_value.isoformat()
|
new_value = new_value.isoformat() + 'Z'
|
||||||
jsonpatch.append(
|
jsonpatch.append(
|
||||||
{
|
{
|
||||||
'op': 'replace',
|
'op': 'replace',
|
||||||
|
Loading…
Reference in New Issue
Block a user