Exemple #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
Exemple #2
0
 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
Exemple #3
0
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
Exemple #4
0
    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
Exemple #5
0
    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
Exemple #6
0
 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