django-datatable-view example project

Running django-datatable-view 0.7.1, django 1.4.10 datatables.js 1.10.0

Click on an example type in the sidebar to interact with a live table and read details on how it can be implemented.

Database status

Your database tables appear sync'd! Check out the example pages at your leisure.

Main topics

The demos and example code found in this example project all rely on the automatic initialization provided by a simple jQuery document.ready event. A couple of the pages use additional static resources (Bootstrap theme, x-editable); these pages include an HTML comment in the source that highlights their use in the live demo.

Aside from the primary value of this set of examples as a reference site, noteworthy topics that branch outside of basic syntax are:

Models used in the examples

The main model used in most of the examples is Entry, because of its diverse fields. Blog makes a simple relationship demonstration possible, and Author helps shed light on how to handle many to many relationships.

class Blog(models.Model):
    name = models.CharField(max_length=100)
    tagline = models.TextField()

class Author(models.Model):
    name = models.CharField(max_length=50)
    email = models.EmailField()

class Entry(models.Model):
    blog = models.ForeignKey(Blog)
    headline = models.CharField(max_length=255)
    body_text = models.TextField()
    pub_date = models.DateField()
    mod_date = models.DateField()
    authors = models.ManyToManyField(Author)
    n_comments = models.IntegerField()
    n_pingbacks = models.IntegerField()
    rating = models.IntegerField()