def create_live(self): live = Live() self.populate_obj(live) live.user_id = User.query.filter_by(username=self.username.data).first().id db.session.add(live) db.session.commit() return live
def create_live(self): live = Live() self.populate_obj(live) db.session.add(live) db.session.commit() return live
def create_live(self): live = Live() # 使用直播表单数据填充course对象 self.populate_obj(live) db.session.add(live) db.session.commit() return live
def create_live(self): live = Live() self.populate_obj(live) #live.name = self.name.data #live.live_url = self.live_url.data #user_id = self.user_id.data db.session.add(live) db.session.commit() return live
def iter_lives(): yield Live(name=fake.sentence(), live_url='', user_id=1)