Skip to content

Commit

Permalink
fix: Also specify non language key
Browse files Browse the repository at this point in the history
  • Loading branch information
sopelj committed Aug 26, 2024
1 parent 5c581ae commit e57bea0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions recipe_repo/categories/migrations/0002_migrate_categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,23 @@ def migrate_recipe_categories(apps: Apps, schema_editor: BaseDatabaseSchemaEdito

for recipe_category in RecipeCategory.objects.filter(path__depth=1):
category_type = CategoryType.objects.create(
name=recipe_category.name,
name_en=recipe_category.name_en,
name_fr=recipe_category.name_fr,
name_ja=recipe_category.name_ja,
slug=recipe_category.slug,
slug_en=recipe_category.slug_en,
slug_fr=recipe_category.slug_fr,
slug_ja=recipe_category.slug_ja,
image=recipe_category.image,
)
for sub_category in RecipeCategory.objects.filter(path__descendants=recipe_category.path, path__depth=2):
Category.objects.create(
name=sub_category.name,
name_en=sub_category.name_en,
name_fr=sub_category.name_fr,
name_ja=sub_category.name_ja,
slug=sub_category.slug,
slug_en=sub_category.slug_en,
slug_fr=sub_category.slug_fr,
slug_ja=sub_category.slug_ja,
Expand Down

0 comments on commit e57bea0

Please sign in to comment.