multi_dicts#

class starlite.datastructures.multi_dicts.MultiMixin#

Bases: Generic[T], MultiMapping[T], ABC

Mixin providing common methods for multi dicts, used by.

ImmutableMultiDict and MultiDict

dict() Dict[str, List[Any]]#

Return the multi-dict as a dict of lists.

Returns:

A dict of lists

multi_items() Generator[Tuple[str, T], None, None]#

Get all keys and values, including duplicates.

Returns:

A list of tuples containing key-value pairs

getlist(key: str) List[T]#

Get all values.

Parameters:

key – The key

Returns:

A list of values

class starlite.datastructures.multi_dicts.MultiDict#

Bases: MultiDict[T], MultiMixin[T], Generic[T]

MultiDict, using MultiDict.

__init__(args: Optional[Union[MultiMapping, Mapping[str, T], Iterable[Tuple[str, T]]]] = None) None#

Initialize MultiDict from a.

MultiMapping, Mapping or an iterable of tuples.

Parameters:

args – Mapping-like structure to create the MultiDict from

immutable() ImmutableMultiDict[T]#

Create an.

ImmutableMultiDict view.

Returns:

An immutable multi dict

class starlite.datastructures.multi_dicts.ImmutableMultiDict#

Bases: MultiDictProxy[T], MultiMixin[T], Generic[T]

Immutable MultiDict, using.

MultiDictProxy.

__init__(args: Optional[Union[MultiMapping, Mapping[str, Any], Iterable[Tuple[str, Any]]]] = None) None#

Initialize ImmutableMultiDict from a.

MultiMapping, Mapping or an iterable of tuples.

Parameters:

args – Mapping-like structure to create the ImmutableMultiDict from

mutable_copy() MultiDict[T]#

Create a mutable copy as a.

MultiDict

Returns:

A mutable multi dict

class starlite.datastructures.multi_dicts.FormMultiDict#

Bases: ImmutableMultiDict[Any]

MultiDict for form data.

async close() None#

Close all files in the multi-dict.

Returns:

None