class documentation

class RowMapping(BaseRow, collections_abc.Mapping):

View In Hierarchy

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])
New in version 1.4: The .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
def __contains__(self, key):

Undocumented

def __iter__(self):
def __len__(self):

Undocumented

def __repr__(self):

Undocumented

def _values_impl(self):
def items(self):
Return a view of key/value tuples for the elements in the underlying .Row.
def keys(self):
Return a view of 'keys' for string column names represented by the underlying .Row.
def values(self):
Return a view of values for the values represented in the underlying .Row.
__slots__: tuple =