Пример #1
0
def add_restaurant_recruitment(data):
    s = DBSession()
    obj = RestaurantRecruitment.from_tobj(data)
    s.add(obj)
    s.flush()
    obj_id = obj.id
    return obj_id
Пример #2
0
def update_restaurant_recruitment(data):
    s = DBSession()
    obj = RestaurantRecruitment.from_tobj(data)
    # todo 检查data中id是否存在,数据库中对应id是否存在
    s.merge(obj)
    return True