In your example, 'sts' represents a single row from the database. These
objects don't have an 'update' method, which is why you are getting that
error. It thinks you are trying to access a column called 'update'
instead.
You appear to be using the SQL Expression language (ie. MyTable is
created using sqlalchemy.Table). You can create an 'update' statement
using MyTable.update(). Examples are at:
http://www.sqlalchemy.org/docs/core/tutorial.html#inserts-and-updates
(You should be able to substitute conn.execute() with session.execute())
However, you might be interested in using the ORM part of SQLAlchemy:
http://www.sqlalchemy.org/docs/orm/tutorial.html
Your usage would then look something like this (assuming MyMappedClass
is the class mapped to MyTable):
s = MyMappedClass
query = self.session.query(s).filter(s.my_name == self.my_name)
sts = query.first()
sts.status = 'L'
self.session.flush()
Hope that helps,
Simon