Skip to content

Instantly share code, notes, and snippets.

@teaguexiao
teaguexiao / DataTables.py
Created April 27, 2016 15:28 — forked from kaiserama/DataTables.py
Jquery DataTables class implementation in Flask with MySQL. There was an example of using DataTables with MongoDB + Flask, but nothing for using MySQL + Flask. Be sure you install Flask-MySQL extension first!
from MySQLdb import cursors
from flask import request
class DataTablesServer(object):
def __init__( self, request, columns, index, table, cursor):
self.columns = columns
self.index = index
self.table = table
# values specified by the datatable for filtering, sorting, paging