示例#1
0
def ajax_submit_task():
    input_data = dict()
    input_data = request.get_json()
    try:
        submit_user = input_data['submit_user']
    except:
        return 'no submit_user information'
    now_ts = int(time.time())
    input_data['submit_date'] = now_ts
    #print '###################'
    status = submit_tasks(input_data)
    return json.dumps(status)
示例#2
0
文件: views.py 项目: SwoJa/ruman
def ajax_submit_task():
    input_data = dict()
    input_data = request.get_json()
    try:
        submit_user = input_data['submit_user']
    except:
        return 'no submit_user information'
    now_ts = int(time.time())
    input_data['submit_date'] = now_ts
    #print '###################'
    status = submit_tasks(input_data)
    return json.dumps(status)
示例#3
0
def upload_file():
    upload_data = request.form['upload_data']
    task_name = request.form['task_name']
    state = request.form['state']
    now_ts = time.time()
    now_date = ts2datetime(now_ts)
    line_list = upload_data.split('\n')
    input_data = {}
    input_data['submit_date'] = now_date
    input_data['task_name'] = task_name
    input_data['state'] = state
    uid_list = []
    for line in line_list:
        uid = line[:10]
        if len(uid) == 10:
            uid_list.append(uid)
    input_data['uid_list'] = uid_list
    status = submit_tasks(input_data)
    return json.dumps(status)
示例#4
0
文件: views.py 项目: SwoJa/ruman
def upload_file():
    upload_data = request.form['upload_data']
    task_name = request.form['task_name']
    state = request.form['state']
    now_ts = time.time()
    now_date = ts2datetime(now_ts)
    line_list = upload_data.split('\n')
    input_data = {}
    input_data['submit_date'] = now_date
    input_data['task_name'] = task_name
    input_data['state'] = state
    uid_list = []
    for line in line_list:
        uid = line[:10]
        if len(uid)==10:
            uid_list.append(uid)
    input_data['uid_list'] = uid_list
    status = submit_tasks(input_data)
    return json.dumps(status)