Re: [sqlalchemy] How to update TableRelations

2010-10-22 Thread Aydın ŞEN
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

Re: [sqlalchemy] How to update TableRelations

2010-10-22 Thread Michael Bayer
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

Re: [sqlalchemy] How to update TableRelations

2010-10-22 Thread Aydın ŞEN
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().

Re: [sqlalchemy] How to update TableRelations

2010-10-21 Thread Michael Bayer
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,

[sqlalchemy] How to update TableRelations

2010-10-20 Thread Aydın ŞEN
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,