class RowMapping(BaseRow, collections_abc.Mapping):
A Mapping that maps column names and objects to .Row
values.
The .RowMapping
is available from a .Row
via the
.Row._mapping
attribute, as well as from the iterable interface
provided by the .MappingResult
object returned by the
_engine.Result.mappings
method.
.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])
.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 | __iter__ |
Undocumented |
Method | __len__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | _values_impl |
Undocumented |
Method | items |
Return a view of key/value tuples for the elements in the underlying .Row . |
Method | keys |
Return a view of 'keys' for string column names represented by the underlying .Row . |
Method | values |
Return a view of values for the values represented in the underlying .Row . |
Class Variable | __slots__ |
Undocumented |
Inherited from BaseRow
:
Method | __getattr__ |
Undocumented |
Method | __hash__ |
Undocumented |
Method | __init__ |
Row objects are constructed by CursorResult objects. |
Method | __reduce__ |
Undocumented |
Method | _filter_on_values |
Undocumented |
Method | _get_by_int_impl |
Undocumented |
Method | _get_by_key_impl |
Undocumented |
Method | _get_by_key_impl_mapping |
Undocumented |