Skip to content

Commit

Permalink
Migrates the old visual translation community to datagrowth
Browse files Browse the repository at this point in the history
  • Loading branch information
fako committed Jan 27, 2020
1 parent f981d55 commit eb238dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class Command(GrowDatasetCommand):

dataset_model = "VisualTranslationsEUCommunity"
dataset_model = "visual_translations.VisualTranslationsEUCommunity"

def add_arguments(self, parser):
super().add_arguments(parser)
Expand Down
6 changes: 3 additions & 3 deletions visual_translations/models/eu.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class VisualTranslationsEUCommunity(Community):
"contribute": "Append:ExtractProcessor.extract_from_resource",
"output": "Collective",
"config": {
"_args": ["translate_from", "$.translate_to", "$.query"],
"_args": ["$.translate_from", "$.translate_to", "$.query"],
"_kwargs": {},
"_resource": "GoogleTranslate",
"_objective": {
Expand Down Expand Up @@ -181,7 +181,7 @@ def finish_translations(self, out, err):
properties["images_quantity"] = grid["columns"] * grid["rows"]
new.append(properties)
if new:
out.add(new)
out.add(new, reset=True)

def finish_images(self, out, err):
translations = self.growth_set.filter(type="translations").last()
Expand All @@ -199,7 +199,7 @@ def finish_images(self, out, err):
community=self,
schema=out.schema
)
col.add(images)
col.add(images, reset=True)
ind.properties["images"] = col.url
ind.save()

Expand Down

0 comments on commit eb238dd

Please sign in to comment.