def add_restaurant_recruitment(data): s = DBSession() obj = RestaurantRecruitment.from_tobj(data) s.add(obj) s.flush() obj_id = obj.id return obj_id
def add(cls, restaurant_id=None, call_status=None, created_at=datetime.now(), phone=None, flush=False): session = DBSession() voice_call = cls(restaurant_id=restaurant_id, call_status=call_status, created_at=created_at, phone=phone) session.add(voice_call) if flush: session.flush() return voice_call
def add_change_record(user_id, from_type, to_type): session = DBSession() new_record = CSProcessTypeChangeRecord( user_id=user_id, from_type=from_type, to_type=to_type ) session.add(new_record) session.flush() return new_record.id
def add(cls, restaurant_id, ban_type, flush=False): session = DBSession() exist_ban = cls.get_by_restaurant(restaurant_id) if not exist_ban: ban = cls(restaurant_id=restaurant_id, ban_type=ban_type) session.add(ban) if flush: session.flush() return ban return None
def add(cls, restaurant_id, ban_type, flush=False): session = DBSession() exist_ban = cls.get_by_restaurant(restaurant_id) if not exist_ban: ban = cls(restaurant_id=restaurant_id, ban_type=ban_type) session.add(ban) if flush: session.flush() return ban return None
def add(cls, restaurant_id=None, call_status=None, created_at=datetime.now(), phone=None, flush=False): session = DBSession() voice_call = cls(restaurant_id=restaurant_id, call_status=call_status, created_at=created_at, phone=phone) session.add(voice_call) if flush: session.flush() return voice_call