Skip to main content

A Django app that integrates with DataTables.net javascript api.

Project description

Datatables

Datatables is a Django app that which gives the possibility to create views that integrates with the jQuery javascript library DataTables.

It also includes some features which makes it possible to export data to a csv from the table.

Installation

Add 'datatables' to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'datatables',
    ]

Usage

  1. Create a view:
from datatables.views import DatatableView
from someapp.models import MyModel


class ExampleView(DatatableView):
    model = MyModel
    columns = [
        'field1',
        'field2',
        'custom_data',
    ]

    def custom_data(self, obj):
        return 'some custom data'
  1. Add css and js to template: example.html
{% load datatables %}

<html>
    <head>
    {% css_bundle %}
    </head>
    <body>
    {{ datatable }}
    </body>
    {% js_bundle %}
</html>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_datatablesview-0.10.1.tar.gz (148.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_datatablesview-0.10.1-py3-none-any.whl (159.1 kB view details)

Uploaded Python 3

File details

Details for the file django_datatablesview-0.10.1.tar.gz.

File metadata

  • Download URL: django_datatablesview-0.10.1.tar.gz
  • Upload date:
  • Size: 148.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for django_datatablesview-0.10.1.tar.gz
Algorithm Hash digest
SHA256 c6d7f6100ae16156412c1fda668b56cc2000a8d3cb3c575ceb9f8adc770628e4
MD5 2961804a6229482fa88d64146c5d9ce8
BLAKE2b-256 d7e01d137833f074a8eabcfd57ae390a94255a7b38a1b5afbd5531eb7caab701

See more details on using hashes here.

File details

Details for the file django_datatablesview-0.10.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_datatablesview-0.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b4c9cdb1682452a0c76372cab492423a91ba89bba7fec4c876d50d3ed9253f50
MD5 34b96e3244ed403a7cc1c833a52aaca7
BLAKE2b-256 9ca7bab2b4a3c3af539c8e33c3cad8bd04368a97d059d6b5a331c30459222b00

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page