class documentation

class LegacyRow(Row):

Known subclasses: sqlalchemy.engine.cursor.BufferedColumnRow

View In Hierarchy

A subclass of .Row that delivers 1.x SQLAlchemy behaviors for Core.

The .LegacyRow class is where most of the Python mapping (i.e. dictionary-like) behaviors are implemented for the row object. The mapping behavior of .Row going forward is accessible via the .Row._mapping attribute.

New in version 1.4: - added .LegacyRow which encapsulates most of the deprecated behaviors of .Row.
Method __contains__ Undocumented
Method has​_key Return True if this .LegacyRow contains the given key.
Method items Return a list of tuples, each tuple containing a key/value pair.
Method iterkeys Return a an iterator against the .Row.keys method.
Method itervalues Return a an iterator against the .Row.values method.
Method values Return the values represented by this .Row as a list.
Class Variable __slots__ Undocumented

Inherited from Row:

Method __delattr__ Undocumented
Method __eq__ Undocumented
Method __ge__ Undocumented
Method __getstate__ Undocumented
Method __gt__ Undocumented
Method __le__ Undocumented
Method __lt__ Undocumented
Method __ne__ Undocumented
Method __repr__ Undocumented
Method __setattr__ Undocumented
Method __setstate__ Undocumented
Method ​_asdict Return a new dict which maps field names to their corresponding values.
Method ​_op Undocumented
Method ​_replace Undocumented
Method ​_special​_name​_accessor Handle ambiguous names such as "count" and "index"
Method keys Return the list of keys as strings represented by this .Row.
Class Variable count Undocumented
Class Variable index Undocumented
Property ​_field​_defaults Undocumented
Property ​_fields Return a tuple of string keys as represented by this .Row.
Property ​_mapping Return a .RowMapping for this .Row.

Inherited from BaseRow (via Row):

Method __getattr__ Undocumented
Method __hash__ Undocumented
Method __init__ Row objects are constructed by CursorResult objects.
Method __iter__ Undocumented
Method __len__ Undocumented
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
Method ​_values​_impl Undocumented
def __contains__(self, key):
@util.deprecated('1.4', 'The :meth:`.LegacyRow.has_key` method is deprecated and will be removed in a future release. To test for key membership, use the :attr:`Row._mapping` attribute, i.e. \'key in row._mapping`.')
def has_key(self, key):

Return True if this .LegacyRow contains the given key.

Through the SQLAlchemy 1.x series, the __contains__() method of .Row (or .LegacyRow as of SQLAlchemy 1.4) also links to .Row.has_key, in that an expression such as

"some_col" in row

Will return True if the row contains a column named "some_col", in the way that a Python mapping works.

However, it is planned that the 2.0 series of SQLAlchemy will reverse this behavior so that __contains__() will refer to a value being present in the row, in the way that a Python tuple works.

@util.deprecated('1.4', 'The :meth:`.LegacyRow.items` method is deprecated and will be removed in a future release. Use the :attr:`Row._mapping` attribute, i.e., \'row._mapping.items()\'.')
def items(self):

Return a list of tuples, each tuple containing a key/value pair.

This method is analogous to the Python dictionary .items() method, except that it returns a list, not an iterator.

@util.deprecated('1.4', 'The :meth:`.LegacyRow.iterkeys` method is deprecated and will be removed in a future release. Use the :attr:`Row._mapping` attribute, i.e., \'row._mapping.keys()\'.')
def iterkeys(self):

Return a an iterator against the .Row.keys method.

This method is analogous to the Python-2-only dictionary .iterkeys() method.

@util.deprecated('1.4', 'The :meth:`.LegacyRow.itervalues` method is deprecated and will be removed in a future release. Use the :attr:`Row._mapping` attribute, i.e., \'row._mapping.values()\'.')
def itervalues(self):

Return a an iterator against the .Row.values method.

This method is analogous to the Python-2-only dictionary .itervalues() method.

@util.deprecated('1.4', 'The :meth:`.LegacyRow.values` method is deprecated and will be removed in a future release. Use the :attr:`Row._mapping` attribute, i.e., \'row._mapping.values()\'.')
def values(self):

Return the values represented by this .Row as a list.

This method is analogous to the Python dictionary .values() method, except that it returns a list, not an iterator.

__slots__: tuple =

Undocumented