Skip to main content

Searchable and paginable ListView

Project description


[![Build Status](](
[![Coverage Status](](
[![Code Health](](

ListView which can be searchable, paginate and which doesn't lose query parameter and page number


This library need jQuery ( and Bootstrap for the frond-end )
To install it in your vitualenv on your django project

```{r, engine='bash', count_lines}
pip install django-search-listview


Only paginate ListView

from search_listview.list import SearchableListView

class ListDevicePaginate(SearchableListView):
model = Device
template_name = "tests/list.html"
paginate_by = 10

Paginate + Searchable ListView

from search_listview.list import SearchableListView

class ListDeviceSearchablePaginate(SearchableListView):
model = Device
template_name = "tests/list.html"
paginate_by = 10
searchable_fields = ["inventory_number", "model_device", "model_device__brand__provider",
specifications = {
"model_device__brand__name": "__icontains"

Put the parameter for the query in **searchable_fields** which will be use to filter the queryset. The specifications which be use in the same way.

In the template

- Where you want the pagination and the search box

<div class="row">
{% include "search_listview/search_and_page.html" %}

- In the footer

<!--Need jQuery-->
<script src="{% static 'search_listview/js/search_listview.js' %}"></script>

Now you have a beautifull box with all the fields you need.

![Alt tag](/docs/search_box.png?raw=true "Search box")

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution (12.0 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page