예제 #1
0
파일: views.py 프로젝트: hylhero/h
def annotations_index(request):
    """Do a search for all annotations on anything and return results.

    This will use the default limit, 20 at time of writing, and results
    are ordered most recent first.
    """
    user = get_user(request)
    return search_lib.index(user=user)
예제 #2
0
파일: views.py 프로젝트: ningyifan/h
def annotations_index(request):
    """Do a search for all annotations on anything and return results.

    This will use the default limit, 20 at time of writing, and results
    are ordered most recent first.
    """
    search_normalized_uris = request.feature('search_normalized')

    user = get_user(request)
    results = search_lib.index(user=user,
                               search_normalized_uris=search_normalized_uris)

    return {
        'total': results['total'],
        'rows': [search_lib.render(a) for a in results['rows']],
    }
예제 #3
0
파일: views.py 프로젝트: ningyifan/h
def annotations_index(request):
    """Do a search for all annotations on anything and return results.

    This will use the default limit, 20 at time of writing, and results
    are ordered most recent first.
    """
    search_normalized_uris = request.feature('search_normalized')

    user = get_user(request)
    results = search_lib.index(user=user,
                               search_normalized_uris=search_normalized_uris)

    return {
        'total': results['total'],
        'rows': [search_lib.render(a) for a in results['rows']],
    }
예제 #4
0
파일: search_test.py 프로젝트: stuk88/h
def test_index_limit_is_20(search_func):
    """index() calls search with "limit": 20."""
    search.index()

    first_call = search_func.call_args_list[0]
    assert first_call[0][0]["limit"] == 20
예제 #5
0
def test_index_limit_is_20(search_func):
    """index() calls search with "limit": 20."""
    search.index()

    first_call = search_func.call_args_list[0]
    assert first_call[0][0]["limit"] == 20