File: results_per_page_urls.py

package info (click to toggle)
django-haystack 3.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,512 kB
  • sloc: python: 23,577; xml: 1,708; makefile: 71; sh: 65
file content (17 lines) | stat: -rw-r--r-- 352 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from django.urls import path

from haystack.views import SearchView


class CustomPerPage(SearchView):
    results_per_page = 1


urlpatterns = [
    path("search/", CustomPerPage(load_all=False), name="haystack_search"),
    path(
        "search2/",
        CustomPerPage(load_all=False, results_per_page=2),
        name="haystack_search",
    ),
]