class RowMapping(BaseRow, typing.Mapping[
A ``Mapping`` that maps column names and objects to :class:`.Row` values. The :class:`.RowMapping` is available from a :class:`.Row` via the :attr:`.Row._mapping` attribute, as well as from the iterable interface provided by the :class:`.MappingResult` object returned by the :meth:`_engine.Result.mappings` method. :class:`.RowMapping` supplies Python mapping (i.e. dictionary) access to the contents of the row. This includes support for testing of containment of specific keys (string column names or objects), as well as iteration of keys, values, and items:: for row in result: if 'a' in row._mapping: print("Column 'a': %s" % row._mapping['a']) print("Column b: %s" % row._mapping[table.c.b]) .. versionadded:: 1.4 The :class:`.RowMapping` object replaces the mapping-like access previously provided by a database result row, which now seeks to behave mostly like a named tuple.
Method | __contains__ |
Undocumented |
Method | __getitem__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __len__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | items |
Return a view of key/value tuples for the elements in the underlying :class:`.Row`. |
Method | keys |
Return a view of 'keys' for string column names represented by the underlying :class:`.Row`. |
Method | values |
Return a view of values for the values represented in the underlying :class:`.Row`. |
Class Variable | __slots__ |
Undocumented |
Method | _values |
Undocumented |
Inherited from BaseRow
:
Method | __getattr__ |
Undocumented |
Method | __getstate__ |
Undocumented |
Method | __hash__ |
Undocumented |
Method | __init__ |
Row objects are constructed by CursorResult objects. |
Method | __reduce__ |
Undocumented |
Method | __setstate__ |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Class Variable | _data |
Undocumented |
Class Variable | _key |
Undocumented |
Class Variable | _keymap |
Undocumented |
Class Variable | _parent |
Undocumented |