allow using a single string as an ingredient instead of a dict
This commit is contained in:
parent
072aa03a53
commit
883f0756f9
5 changed files with 59 additions and 17 deletions
|
@ -139,7 +139,8 @@ class Builder:
|
|||
def collect_unitnames(rec: parsing.Recipe) -> List[str]:
|
||||
results: List[str] = []
|
||||
for ing in rec.ingredients:
|
||||
results.append(ing.unit.name)
|
||||
if ing.unit is not None:
|
||||
results.append(ing.unit.name)
|
||||
return results
|
||||
|
||||
unitnamelists = self.foreach_recipe(collect_unitnames)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue