我想直接更新我的sqlalchemy类,然后将更改插入数据库并返回最近插入的ID。下面是我要工作的代码。
Series.is_forfeited = is_forfeited
Series.start_date_time =date_time
Series.is_finished = is_finished
Series.is_live = is_live
instance = 'Convert newly updated object to instance'
session.add(instance)
session.commit()
id = instance.id
答案 0 :(得分:0)
好像您没有初始化实例。试试这个:
setDT(df2)[df1, on = .(ID, date > start_date, date <= end_date)]