Esempio n. 1
0
def ajax_node_edit():
    node_type = request.args.get('node_type', 'Event')  #User , Org
    item = request.args.get('item', '1')
    editor = request.args.get('submit_user', '*****@*****.**')  #admin
    start_ts = request.args.get('start_ts', '')  # 1504195000
    end_ts = request.args.get('end_ts', '')  # 1504195300
    if start_ts and end_ts:
        node_result = search_node_time_limit(node_type, item, start_ts, end_ts,
                                             editor)
    else:
        if node_type == 'User' or node_type == 'Org':
            field = [
                'uid', 'uname', 'location', 'influence', 'activeness',
                'sensitive', 'keywords_string', 'function_mark'
            ]
            node_result = search_user(item, field, editor, node_type)
        if node_type == 'Event':
            # field = ['en_name', 'submit_ts',  'uid_counts', 'weibo_counts']
            field = [
                'en_name', 'name', 'event_type', 'real_time', 'real_geo',
                'uid_counts', 'weibo_counts', 'keywords', 'work_tag',
                'compute_status'
            ]
            node_result = search_event(item, field, editor)
    return json.dumps(node_result)
Esempio n. 2
0
def ajax_relation_edit_search():
    node_type = request.args.get('node_type', 'User') #User , Org
    item = request.args.get('item', '1')
    if node_type == 'User' or node_type == 'Org':
        field = ['uid', 'uname']
        result = search_user(item, field, '', node_type)
    if node_type == 'Event':
        field = ['en_name', 'name']
        result = search_event(item, field, '')
    return json.dumps(result)
Esempio n. 3
0
def ajax_search_node():
    node_type = request.args.get('node_type', 'Event') #User , Org
    item = request.args.get('item', '1')
    if node_type == 'User' or node_type == 'Org':
        field = ['uid', 'uname']
        result = search_user(item, field)
    if node_type == 'Event':
        field = ['en_name', 'name']  #改成name
        result = search_event(item, field)
    return json.dumps(result)