mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
keyword update, tests sqlite and PG
This commit is contained in:
@@ -148,14 +148,9 @@ def import_url(request):
|
||||
|
||||
recipe.steps.add(step)
|
||||
|
||||
all_keywords = Keyword.get_tree()
|
||||
for kw in data['keywords']:
|
||||
q = all_keywords.filter(name=kw['text'], space=request.space)
|
||||
if len(q) != 0:
|
||||
recipe.keywords.add(q[0])
|
||||
elif data['all_keywords']:
|
||||
k = Keyword.add_root(name=kw['text'], space=request.space)
|
||||
recipe.keywords.add(k)
|
||||
k = Keyword.objects.get_or_create(name=kw['text'], space=request.space)
|
||||
recipe.keywords.add(k)
|
||||
|
||||
for ing in data['recipeIngredient']:
|
||||
ingredient = Ingredient(space=request.space,)
|
||||
|
||||
Reference in New Issue
Block a user