コード例 #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
ファイル: search_test.py プロジェクト: robertknight/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