flatten_choices
Flatten choices by removing nested values.
def flatten_choices(
choices: iterable
) - > generator
Flatten choices by removing nested values.
Parameters
| Name | Type | Description |
|---|---|---|
| choices | iterable | An iterable of choice tuples or grouped choices, typically used in form fields or select inputs. |
Returns
| Type | Description |
|---|---|
generator | A generator yielding flat key-value pairs, where nested groups have been expanded into their individual choice tuples. |