Skip to content

Commit

Permalink
Mejora a la performance de indexación de metadatos
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaslavandeira committed Mar 27, 2018
1 parent 2f98c2d commit 604ad08
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def scrap_datajson(self):
actions = []
for field in self.data_json.get_fields(only_time_series=True):
dataset = datasets.setdefault(field['dataset_identifier'],
self.data_json.get_dataset(identifier=field['dataset_identifier']))
self.get_dataset(identifier=field['dataset_identifier']))

doc = Field(
title=field.get('title'),
Expand All @@ -58,6 +58,11 @@ def scrap_datajson(self):
actions.append(doc.to_dict(include_meta=True))
return actions

def get_dataset(self, identifier):
for dataset in self.data_json['dataset']:
if dataset['identifier'] == identifier:
return dataset

@staticmethod
def get_themes(theme_taxonomy):
themes = {}
Expand Down

0 comments on commit 604ad08

Please sign in to comment.