()
return {'status': 'ok'}
update db with user's mark & uid
update db with user's mark & uid
update db with user s mark & uid
def do_mark():
    """ update db with user's mark & uid """
    try:
        pid = long(request.values.get('pid'))
        mark = int(request.values.get('mark'))
    except Exception:
        return {'status': 'error',
                'reason': 'invalid request'}

    db = get_mongo('paper')
    if mark == 1:
        db.update({'_id': pid}, {'$inc': {'upvote': 1}})
    else:
        db.update({'_id': pid}, {'$inc': {'downvote': 1}})
    log_info("Add mark to pdf {0}".format(pid))

    return {'status': 'ok'}
def do_mark ( ) : try : pid = long ( request . values . get ( 'pid' ) ) mark = int ( request . values . get ( 'mark' ) ) except Exception : return { 'status' : 'error' , 'reason' : 'invalid request' } db = get_mongo ( 'paper' ) if mark == 1 : db . update ( { '_id' : pid } , { '$inc' : { 'upvote' : 1 } } ) else : db . update ( { '_id' : pid } , { '$inc' : { 'downvote' : 1 } } ) log_info ( "Add mark to pdf {0}" . format ( pid ) ) return { 'status' : 'ok' }