例如:
class User(Base): __tablename__ = 'users' id = Column(Integer,primary_key=True) name = Column(String) fullname = Column(String) password = Column(String)
可以从id = 3,{name:“diana”}或id = 15更新,{name:“marchel”,fullname:“richie marchel”}
user = session.query(User).get(someid) for key,value in yourdict.iteritems(): setattr(user,key,value)