MCPcopy
hub / github.com/django/django / CallableChoiceIterator

Class CallableChoiceIterator

django/utils/choices.py:53–60  ·  view source on GitHub ↗

Iterator to lazily normalize choices generated by a callable.

Source from the content-addressed store, hash-verified

51
52
53class CallableChoiceIterator(BaseChoiceIterator):
54 """Iterator to lazily normalize choices generated by a callable."""
55
56 def __init__(self, func):
57 self.func = func
58
59 def __iter__(self):
60 yield from normalize_choices(self.func())
61
62
63def flatten_choices(choices):

Callers 1

normalize_choicesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected