This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description


This package provides a Django class-based view used for showing a list of objects with a search form.


  • searching multiple fields
  • set filtering operators
  • set fixed filters
  • pass in lists as fiters

This is a work in progress!


python install


Important: API has changed since v. 0.1.0, in particular filters are now configured in their own class derived from searchlist_views.filters.BaseFilter.




The following code sets up model, form and view for displaying an “Actors List”.

class Actor(models.Model):
    name = models.CharField(max_length=32)
    surname = models.CharField(max_length=32)
    age = models.IntegerField()

from .models import Actor
from django import forms
class ActorSearchForm(forms.Form):
    search_text =  forms.CharField(
                    required = False,
                    label='Search name or surname!',
                    widget=forms.TextInput(attrs={'placeholder': 'search here!'})

    search_age_exact = forms.IntegerField(
                    required = False,
                    label='Search age (exact match)!'

    search_age_min = forms.IntegerField(
                    required = False,
                    label='Min age'

    search_age_max = forms.IntegerField(
                    required = False,
                    label='Max age'

from .model import Actor
from .forms import ActorSearchForm
from import SearchListView
from searchlist_views.filters import BaseFilter

class ActorsFilter(BaseFilter):
    search_fields = {
        'search_text' : ['name', 'surname'],
        'search_age_exact' : { 'operator' : '__exact', 'fields' : ['age'] },
        'search_age_min' : { 'operator' : '__gte', 'fields' : ['age'] },
        'search_age_max' : { 'operator' : '__lte', 'fields' : ['age'] },


class ActorsSearchList(SearchListView):
    model = Actor
    paginate_by = 30
    template_name = "actors/actors_list.html"
    form_class = ActorSearchForm
    filter_class = ActorsFilter

view template “actors/actors_list.html”:

{% extends "base.html" %}

{% block content%}

<div class="container">

    <h2>Actors list</h2>

    <form class="form-inline" action="" method="GET">
        {{ form }}
        <button class="btn" type="submit">Search</button>

    <table class="table table-bordered table-condensed">
        {% for object in object_list %}
        {% endfor %}

    {% if is_paginated %}
        {% include "paginator.html" %}
    {% endif %}


{% endblock %}

License and development

This project is MIT licensed and maintained by Inmagik, suggestions and pull requests are welcome via the Github project page

Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-search-views-0.2.0.tar.gz (6.4 kB) Copy SHA256 Checksum SHA256 Source Oct 1, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting