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
I am conditionally changing the form by adding and removing its fields. I follow the guide to dynamic layouts, but I don't like the indexed addressing because of its WETness: If I add a new field, I'll have to update the indices. There is a way to select a field using its name, but it doesn't work if I want to delete a field.
name_field=self.helper["name"] # finedelself.helper["name"] # TypeError: list indices must be integers or slices, not str
Proposed solution
Extract the key finding logic from DynamicLayoutHandler.__get_item__ and make it available for __del_item__ (and __set_item__, for that matter)
The text was updated successfully, but these errors were encountered:
Description:
I am conditionally changing the form by adding and removing its fields. I follow the guide to dynamic layouts, but I don't like the indexed addressing because of its WETness: If I add a new field, I'll have to update the indices. There is a way to select a field using its name, but it doesn't work if I want to delete a field.
Proposed solution
Extract the key finding logic from
DynamicLayoutHandler.__get_item__
and make it available for__del_item__
(and__set_item__
, for that matter)The text was updated successfully, but these errors were encountered: