{ "info": { "author": "Quentin Schroter", "author_email": "qschroter@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Django-SearchableListView\n=========================\n\n[](https://travis-ci.org/SchroterQuentin/django-search-listview)\n[](https://coveralls.io/github/SchroterQuentin/Django-SearchableListView)\n[](https://landscape.io/github/SchroterQuentin/django-search-listview/master)\n\nListView which can be searchable, paginate and which doesn't lose query parameter and page number\n\nInstallation\n------------\n\nThis library need jQuery ( and Bootstrap for the frond-end ) \nTo install it in your vitualenv on your django project\n\n```{r, engine='bash', count_lines}\npip install django-search-listview\n```\n\n```python\nINSTALLED_APPS = [\n ...\n 'search_listview',\n]\n```\n\n\nOnly paginate ListView\n----------------------\n\n```python\nfrom search_listview.list import SearchableListView\n\nclass ListDevicePaginate(SearchableListView):\n model = Device\n template_name = \"tests/list.html\"\n paginate_by = 10\n```\n \nPaginate + Searchable ListView\n------------------------------\n\n```python\nfrom search_listview.list import SearchableListView\n\nclass ListDeviceSearchablePaginate(SearchableListView):\n model = Device\n template_name = \"tests/list.html\"\n paginate_by = 10\n searchable_fields = [\"inventory_number\", \"model_device\", \"model_device__brand__provider\",\n \"model_device__brand__name\"]\n specifications = {\n \"model_device__brand__name\": \"__icontains\"\n }\n```\n\nPut 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.\n\nIn the template\n---------------\n\n- Where you want the pagination and the search box\n\n```html\n