示例#1
0
文件: app.py 项目: jafna/sortit-app
def get_average_items():
    tags = request.args.getlist('tags')
    averageRatings = redis_functions.get_average_ratings(
        tags, globals.MAX_ITEMS_IN_ONE_SORT)
    print averageRatings
    results = redis_functions.get_items(averageRatings)
    return jsonify(items=results, state="success")
示例#2
0
文件: app.py 项目: jafna/sortit-app
def get_active_channels():
    tags = request.args.getlist('tags')
    active_channels = redis_functions.get_activity(tags, 3)
    results = []
    for string in active_channels:
        categories = string.split("+")
        avg = redis_functions.get_average_ratings(categories, 2)
        results.append({'tags':categories, 'items':redis_functions.get_items(avg)})
    return jsonify(channels = results, state="success")
示例#3
0
文件: app.py 项目: jafna/sortit-app
def get_active_channels():
    tags = request.args.getlist('tags')
    active_channels = redis_functions.get_activity(tags, 3)
    results = []
    for string in active_channels:
        categories = string.split("+")
        avg = redis_functions.get_average_ratings(categories, 2)
        results.append({
            'tags': categories,
            'items': redis_functions.get_items(avg)
        })
    return jsonify(channels=results, state="success")
示例#4
0
文件: app.py 项目: jafna/sortit-app
def get_average_items():
    tags = request.args.getlist('tags')
    averageRatings = redis_functions.get_average_ratings(tags, globals.MAX_ITEMS_IN_ONE_SORT)
    print averageRatings
    results = redis_functions.get_items(averageRatings)
    return jsonify(items = results, state="success")