Exemplo n.º 1
0
def ajax_cancel_delete():
    data = request.args.get('data','') # uid,uid
    date = request.args.get('date', '') # date, 2013-09-01
    if not data or not date:
        return "no one cancelled"
    else:
        uid_list = data.split(',')
        delete_list = json.loads(r_out.hget('decide_delete_list',date))
        revise_list = list(set(delete_list).difference(set(uid_list)))
        r_out.hset('decide_delete_list', date, json.dumps(revise_list))

        update_record_index(uid_list) #temporary 

    return json.dumps(1)
Exemplo n.º 2
0
def ajax_cancel_recommend_out():
    date = request.args.get('date', '') # date, 2013-09-01
    uid_list = request.args.get('uid_list', '') # uid_list, 12345,123456,

    if not date or not uid_list:
        return "no define date or uid_list"
    else:
        uid_list = str(uid_list).split(',')

        recommend_list = json.loads(r_out.hget('recommend_delete_list',date))
        revise_list = list(set(recommend_list).difference(set(uid_list)))
        r_out.hset('recommend_delete_list',date, json.dumps(revise_list))

        update_record_index(uid_list) # 更改low number使之不再推荐

    return json.dumps(1)