eztables – Main package

eztables.forms – DataTables pagination form processing

class eztables.forms.DatatablesForm(*args, **kwargs)[source]

Bases: django.forms.forms.Form

Datatables server side processing Form

See: http://www.datatables.net/usage/server-side

bRegex = None

True if the global filter should be treated as a regular expression for advanced filtering, false if not.

iColumns = None

Number of columns being displayed (useful for getting individual column search info)

iDisplayLength = None

Number of records that the table can display in the current draw. It is expected that the number of records returned will be equal to this number, unless the server has fewer records to return.

iDisplayStart = None

Display start point in the current data set.

iSortingCols = None

Number of columns to sort on

sEcho = None

Information for DataTables to use for rendering.

sSearch = None

Global search field

eztables.views – DataTables server-side processing view

class eztables.views.DatatablesView(**kwargs)[source]

Bases: django.views.generic.list.MultipleObjectMixin, django.views.generic.base.View

Render a paginated server-side Datatables JSON view.

See: http://www.datatables.net/usage/server-side


Test if a given field supports regex lookups

Filter a queryset with column search


Get ordering fields for QuerySet.order_by


Get the requested page


Apply Datatables sort and search criterion to QuerySet


Format a single row (if necessary)


Format all rows

Filter a queryset with global search

render_to_response(form, **kwargs)[source]

Render Datatables expected JSON format

eztables.views.UNSUPPORTED_REGEX_FIELDS = (<class 'django.db.models.fields.IntegerField'>, <class 'django.db.models.fields.BooleanField'>, <class 'django.db.models.fields.NullBooleanField'>, <class 'django.db.models.fields.FloatField'>, <class 'django.db.models.fields.DecimalField'>)

SQLite unsupported field types for regex lookups

eztables.views.get_real_field(model, field_name)[source]

Get the real field from a model given its name.

Handle nested models recursively (aka. __ lookups)

eztables.templatetags.eztables – Template tags