2010/10/22 Michael Bayer mike...@zzzcomputing.com
query has an update():
query(MyTable).filter(MyTable.id==5).update(myDict)
otherwise:
for k in myDict:
setattr(some_object, k, myDict[k])
Session.commit()
yeap, update() is doing what i want.
same techniques, update myDict with
On Oct 22, 2010, at 5:30 AM, Aydın ŞEN wrote:
2010/10/22 Michael Bayer mike...@zzzcomputing.com
query has an update():
query(MyTable).filter(MyTable.id==5).update(myDict)
otherwise:
for k in myDict:
setattr(some_object, k, myDict[k])
Session.commit()
yeap, update() is
2010/10/22 Michael Bayer mike...@zzzcomputing.com
more specifically, query(Category).filter(...).update(some_dict) for the
update version - the filter criterion would be used to target each set of
rows you'd like to UPDATE. The relationship() construct is not used with
query.update().
On Oct 20, 2010, at 3:38 AM, Aydın ŞEN wrote:
I defined my tables below as declarative
class MyTable(Base):
__tablename__ = 'mytable'
id = Column(Integer,primary_key = True)
title = Column(String(200))
description = Column(String(200))
dt_st = Column(Date,
I defined my tables below as declarative
class MyTable(Base):
__tablename__ = 'mytable'
id = Column(Integer,primary_key = True)
title = Column(String(200))
description = Column(String(200))
dt_st = Column(Date, default=func.current_date())
dt_fn = Column(Date,