Skip to content

Commit

Permalink
Cambio interfaz de respuesta de metadatos
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaslavandeira committed Jul 31, 2018
1 parent 65556ec commit 18bd254
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def generate_actions(self):
field_meta = json.loads(field.metadata)
dataset = json.loads(field.distribution.dataset.metadata)
doc = self.doc_type(
periodicity=get_periodicity_human_format_es(periodicity) if periodicity else None,
periodicity=periodicity,
start_date=start_date,
end_date=end_date,
title=field_meta.get('title'),
Expand Down
17 changes: 10 additions & 7 deletions series_tiempo_ar_api/apps/metadata/queries/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,21 @@ def execute(self):

self.response['data'].append({
'field': {
'id': getattr(hit, 'id'),
'description': getattr(hit, 'description'),
'title': getattr(hit, 'title'),
'periodicity': getattr(hit, 'periodicity'),
'id': getattr(hit, 'id', None),
'description': getattr(hit, 'description', None),
'title': getattr(hit, 'title', None),
'periodicity': getattr(hit, 'periodicity', None),
'start_date': start_date,
'end_date': end_date,
'units': getattr(hit, 'units', None),
},
'dataset': {
'title': getattr(hit, 'dataset_title'),
'title': getattr(hit, 'dataset_title', None),
'publisher': {
'name': getattr(hit, 'dataset_publisher_name'),
}
'name': getattr(hit, 'dataset_publisher_name', None),
},
'source': getattr(hit, 'dataset_source', None),
'theme': getattr(hit, 'dataset_theme', None),
}
})

Expand Down
2 changes: 2 additions & 0 deletions series_tiempo_ar_api/apps/metadata/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class MockData:
dataset_title = 'data_title'
dataset_publisher_name = 'pub_name'
periodicity = 'mensual'
units = 'unidades'
dataset_source = 'fuente'
start_date = datetime(2018, 1, 1, 0, 0, 0)
end_date = datetime(2018, 7, 12, 0, 0, 0)

Expand Down

0 comments on commit 18bd254

Please sign in to comment.