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)
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
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