rezeptsuite enhancements

This commit is contained in:
vabene1111 2023-06-20 16:49:00 +02:00
parent 3e0f2fbddc
commit 4b48c1046e
2 changed files with 12 additions and 4 deletions

View File

@ -22,9 +22,12 @@ class Rezeptsuitede(Integration):
name=recipe_xml.find('head').attrib['title'].strip(), name=recipe_xml.find('head').attrib['title'].strip(),
created_by=self.request.user, internal=True, space=self.request.space) created_by=self.request.user, internal=True, space=self.request.space)
if recipe_xml.find('head').attrib['servingtype']: try:
recipe.servings = parse_servings(recipe_xml.find('head').attrib['servingtype'].strip()) if recipe_xml.find('head').attrib['servingtype']:
recipe.servings_text = parse_servings_text(recipe_xml.find('head').attrib['servingtype'].strip()) recipe.servings = parse_servings(recipe_xml.find('head').attrib['servingtype'].strip())
recipe.servings_text = parse_servings_text(recipe_xml.find('head').attrib['servingtype'].strip())
except KeyError:
pass
if recipe_xml.find('remark') is not None: # description is a list of <li>'s with text if recipe_xml.find('remark') is not None: # description is a list of <li>'s with text
if recipe_xml.find('remark').find('line') is not None: if recipe_xml.find('remark').find('line') is not None:
@ -50,7 +53,9 @@ class Rezeptsuitede(Integration):
for ingredient in recipe_xml.find('part').findall('ingredient'): for ingredient in recipe_xml.find('part').findall('ingredient'):
f = ingredient_parser.get_food(ingredient.attrib['item']) f = ingredient_parser.get_food(ingredient.attrib['item'])
u = ingredient_parser.get_unit(ingredient.attrib['unit']) u = ingredient_parser.get_unit(ingredient.attrib['unit'])
amount, unit, note = ingredient_parser.parse_amount(ingredient.attrib['qty']) amount = 0
if ingredient.attrib['qty'].strip() != '':
amount, unit, note = ingredient_parser.parse_amount(ingredient.attrib['qty'])
ingredient_step.ingredients.add(Ingredient.objects.create(food=f, unit=u, amount=amount, space=self.request.space, )) ingredient_step.ingredients.add(Ingredient.objects.create(food=f, unit=u, amount=amount, space=self.request.space, ))
try: try:

View File

@ -239,6 +239,9 @@ RecetteTek exports are `.rtk` files which can simply be uploaded to tandoor to i
## Rezeptsuite.de ## Rezeptsuite.de
Rezeptsuite.de exports are `.xml` files which can simply be uploaded to tandoor to import all your recipes. Rezeptsuite.de exports are `.xml` files which can simply be uploaded to tandoor to import all your recipes.
It appears that Reptsuite, depending on the client, might export a `.zip` file containing a `.cml` file.
If this happens just unzip the zip file and change `.cml` to `.xml` to import your recipes.
## Melarecipes ## Melarecipes
Melarecipes provides multiple export formats but only the `MelaRecipes` format can export the complete collection. Melarecipes provides multiple export formats but only the `MelaRecipes` format can export the complete collection.