You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IngredientController.modules is a list that contains the different UIs ({Description,Ingredient,Instructions,Notes}EditorModules) in the attached to a recipe.
These are now kept in a list, IngredientController.modules, where they are accessed by index.
The correct index for a given module can be found in IngredientController.module_tab_by_name.
This tends to litter the code with a bunch of hardcoded indices, even though the correct way to get a controller is:
Historically, each EditorModule was kept straight in the class as class attributes. I'm not sure what motivated this change.
However, it would be nicer to simply refactor IngredientController.modules to be a dictionary, to access the modules by their names instead of indices:
ingredients=i_controller.module["ingredients"]
The text was updated successfully, but these errors were encountered:
IngredientController.modules
is a list that contains the different UIs ({Description,Ingredient,Instructions,Notes}EditorModules
) in the attached to a recipe.These are now kept in a list,
IngredientController.modules
, where they are accessed by index.The correct index for a given module can be found in
IngredientController.module_tab_by_name
.This tends to litter the code with a bunch of hardcoded indices, even though the correct way to get a controller is:
Historically, each
EditorModule
was kept straight in the class as class attributes. I'm not sure what motivated this change.However, it would be nicer to simply refactor
IngredientController.modules
to be a dictionary, to access the modules by their names instead of indices:The text was updated successfully, but these errors were encountered: