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")
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")
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")
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")