コード例 #1
0
ファイル: rst.py プロジェクト: liuzelei/walis
 def mget_last_record(cls, bankcard_ids):
     session = Session()
     subquery = session.query(cls)\
         .order_by(cls.created_at.desc()).subquery()
     query = session.query(cls, subquery).group_by(subquery.c.rst_id)\
         .filter(subquery.c.id.in_(bankcard_ids))
     return query.all()
コード例 #2
0
 def mget_last_record(cls, bankcard_ids):
     session = Session()
     subquery = session.query(cls)\
         .order_by(cls.created_at.desc()).subquery()
     query = session.query(cls, subquery).group_by(subquery.c.rst_id)\
         .filter(subquery.c.id.in_(bankcard_ids))
     return query.all()
コード例 #3
0
def put():
    recruit_ids = [int(_id) for _id in json.loads(request.data).get("id_list")]
    status_to = int(json.loads(request.data).get("status"))
    session = DBSession()
    recruits = session.query(RestaurantRecruitment).filter(
        RestaurantRecruitment.id.in_(recruit_ids)).all()
    for recruit in recruits:
        recruit.status = status_to
    return ''
コード例 #4
0
ファイル: recruit.py プロジェクト: liuzelei/walis
def put():
    recruit_ids = [int(_id) for _id in
                   json.loads(request.data).get("id_list")]
    status_to = int(json.loads(request.data).get("status"))
    session = DBSession()
    recruits = session.query(RestaurantRecruitment).filter(
        RestaurantRecruitment.id.in_(recruit_ids)).all()
    for recruit in recruits:
        recruit.status = status_to
    return ''
コード例 #5
0
def get_voice_order(order_id):
    voice_order = DBSession.query(VoiceOrder).filter(
        VoiceOrder.order_id == order_id).first()
    return voice_order.serialize()
コード例 #6
0
def mget_voice_order(order_ids):
    voice_orders = DBSession.query(VoiceOrder).filter(
        VoiceOrder.order_id.in_(order_ids)).all()
    return {v_order.order_id: v_order.serialize() for v_order in voice_orders}
コード例 #7
0
ファイル: activity.py プロジェクト: liuzelei/walis
 def get(cls, reply_id):
     return DBSession.query(cls).get(reply_id)
コード例 #8
0
def delete_restaurant_recruitment(_id):
    s = DBSession()
    obj = s.query(RestaurantRecruitment).get(_id)
    s.delete(obj)
    s.commit()
    return True
コード例 #9
0
def get_restaurant_recruitment(_id):
    obj = DBSession.query(RestaurantRecruitment).get(_id)
    return obj.serialize()
コード例 #10
0
 def get(cls, reply_id):
     return DBSession.query(cls).get(reply_id)