Example #1
0
def app_ratings():
    if request.method == "POST":
        return {"error": False}

    def gen():
        i = 0
        while 1:
            yield defaults.rating()
            i += 1

    slug = request.form.get("app") or request.args.get("app")

    data = _paginated("objects", gen)
    data["info"] = {"slug": slug, "average": random.random() * 4 + 1}
    data.update(defaults.app_user_data(slug))
    return data
Example #2
0
def app_ratings(slug):
    def gen():
        i = 0
        while 1:
            yield defaults.rating()
            i += 1
    data = _paginated('ratings', gen)
    result_count = 34
    data.update(defaults.app_user_data(data))
    data['user']['can_rate'] = True
    data['user']['has_rated'] = False
    data['meta'] = {
        'slug': slug,
        'average': random.random() * 4 + 1,
        'count': 24,
    }
    return data
Example #3
0
def app_ratings():
    if request.method == 'POST':
        return {'error': False}

    def gen():
        i = 0
        while 1:
            yield defaults.rating()
            i += 1

    slug = request.form.get('app') or request.args.get('app')

    data = _paginated('objects', gen)
    data['info'] = {
        'slug': slug,
        'average': random.random() * 4 + 1,
    }
    data.update(defaults.app_user_data(slug))
    return data
Example #4
0
def app_ratings():
    if request.method == 'POST':
        return {'error': False}

    def gen():
        i = 0
        while 1:
            yield defaults.rating()
            i += 1

    slug = request.form.get('app') or request.args.get('app')

    data = _paginated('objects', gen)
    data['info'] = {
        'slug': slug,
        'average': random.random() * 4 + 1,
    }
    data.update(defaults.app_user_data(slug))
    return data