Skip to main content

A reusable Django app to make integrations with the DataTables javascript library easy.

Project description

Listable is a Django package to make the integration of your Django models with Datatables.js easy.

Django-listable was motivated by my repeated need to generate sortable and filterable tables from my Django models for CRUD apps.

The idea is that you should easily be able to go from a model like this:

class Staff(models.Model):

    first_name = models.CharField(max_length=255, help_text=_("Enter the name of the staff being rounded"))
    last_name = models.CharField(max_length=255, help_text=_("Enter the name of the staff being rounded"))
    active = models.CharField(max_length=10, choices = ACTIVE_CHOICES)

    position = models.ForeignKey(Position)
    department = models.ForeignKey(Department)

    limit = models.Q(app_label='staff', model='genericmodela') | models.Q(app_label='staff', model='genericmodelb')
    content_type = models.ForeignKey(ContentType, limit_choices_to=limit)
    object_id = models.PositiveIntegerField()
    generic_object = generic.GenericForeignKey("content_type", "object_id")

to a filterable/orderable table in a template like this with as little code as possible:

docs/_static/staff_table.png

There are a couple of other similar projects worth checking out to see if they fit your needs better:

https://badge.fury.io/py/djangoeasytables.png https://pypip.in/d/djangoeasytables/badge.png

History

0.1.2 (2014-07-09)

  • Fix saveState bug

0.1.0 (2013-08-15)

  • First release on PyPI.

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-listable-0.1.4.zip (260.6 kB view hashes)

Uploaded Source

Supported by

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