예제 #1
0
def pending():
    drifts = Drift.query.filter(
        or_(Drift.requester_id == current_user.id,
            Drift.gifter_id == current_user.id)).order_by(
        desc(Drift.create_time)).all()
    view_model = DriftViewModel.pending(drifts)
    return render_template('pending.html', drifts=view_model)
예제 #2
0
파일: drift.py 프로젝트: junxian123/yushu
def get_sent_drift_of_my():
    # 自己赠送出去的鱼漂
    uid = g.user.id
    drifts = Drift.get_sent_drift_of_my(uid)
    drifts = [DriftViewModel(drift) for drift in drifts]
    return jsonify(drifts), 200
예제 #3
0
파일: drift.py 프로젝트: junxian123/yushu
def get_received_drift_of_my():
    # 自己收到鱼漂
    uid = g.user.id
    drifts = Drift.get_received_drift_of_my(uid)
    drifts = [DriftViewModel(drift) for drift in drifts]
    return jsonify(drifts), 200