Generic Filter/Sort Tables for Django?

So this came up (again). Users want to be able to look at a (largish) set of records in Django (millions of records) and do the following:

  • click columns to sort by field values (with indication of sort direction, of course)
  • filter by column values (include, exclude, greater-equal, less-equal); that is, they want to click on a button and have that value be included/excluded or used as a ge/le query
  • see active filters, and be able to remove them
  • see total counts, page through the current result sets
  • make columns foreign-key links (field__remote_field)
  • provide arbitrary formatters for field values
  • cleanly handle all standard data-types (booleans and dates included)
  • handle basic logic, such as removing exclude params when a filter for the same value is added
Bonus points if the solution can handle multiple simultaneous selection sets by the same user and has easy search integration.

So, lazyweb, anyone know of such a beast that can be dropped into Django?


  1. Nick Coghlan

    Nick Coghlan on 12/21/2012 11 p.m. #

    It doesn't do everything you asked for, but I found Django Tables 2 ( to be a lot better than starting from scratch.

    While looking up the link for DT2, I also noticed I haven't tried that one at all, but it seems to be aimed at the kind of filtering capability you mention.

    DT2 uses server-side table rendering though - I think a lot of folks these days use JS table solutions instead, since they can do the sorting, etc, client side.

  2. Wouter van Atteveldt

    Wouter van Atteveldt on 12/22/2012 3:34 p.m. #

    We are using a combination of the rest framework and js datatables that is working fairly well. The web page makes an ajax request back to the rest API and uses js to display it in a nice table featuring search, filtering, and dynamic lazy loading (eg new records are fetched as the scrollbar goes down.

    The glue code is integrated in our larger project ( but we are trying to split it off as a separate project. Drop me a note if you want to help make it into a useful module!

  3. migajek

    migajek on 12/23/2012 8:52 a.m. #

    have a look at the jqGrid and Django-Tastypie. Using those two is pretty straightforward


  4. Michał Pasternak

    Michał Pasternak on 12/26/2012 3:38 p.m. #

    I created something called dojango-datables, , it requires package called dojango, which in turn uses Dojo, which has ambitions to become a JavaScript operating system. Even if I used this solution, I would look for something simpler -- but on the other hand, the filtering is pretty powerful in my project, especially if you take the "millions of records" literally, because it will work.

Comments are closed.


Pingbacks are closed.