Skip to content

MatheusZickuhr/django-datatables-pagination

Repository files navigation

javascript requirements

  • datatables
  • jquery

how to install

pip install django-datatables-pagination

example

ListView

class MyListView(DtPaginatedListView):
    model = MyModel
    tr_template = 'core/tr.html'
    # searchable fields 
    filtered_fields = ('id', 'field1', 'fiild2')

tr.html

<td>{{object.id}}</td>
<td>{{object.field2}}</td>
<td>{{object.field2}}</td>

mymodel_list.html

{% block content %}
    <table class="datatable">
        <tr>
            <th>id</th>
            <th>field1</th>
            <th>field2</th>
        </tr>
    </table>
{% endblock %}

{% block scripts %}
    {% include 'django_datatables_pagination/datatables_setup.html' %}
{% endblock %}

About

A Django ListView integration with datatables library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published