GithubHelp home page GithubHelp logo

tissieres / sqlalchemy-datatables Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pegase745/sqlalchemy-datatables

0.0 1.0 0.0 90 KB

SQLAlchemy integration of jQuery DataTables 1.9.x and 1.10.x (Pyramid and Flask examples)

License: MIT License

Shell 1.68% Python 98.32%

sqlalchemy-datatables's Introduction

sqlalchemy-datatables is a library providing an SQLAlchemy integration of jQuery DataTables. It helps you manage server side requests in your application.

It is framework agnostic, tested with Pyramid and Flask mainly.

It only depends on SQLAlchemy, and is compatible with versions 1.9.x and 1.10.x of DataTables.

Build Status PyPi Version PyPi Downloads Code Quality Coveralls

Installation

To install the stable version:

pip install sqlalchemy-datatables

Usage

views.py

@view_config(route_name='data', renderer='json')
def data(request):
    """Return server side data."""
    # defining columns
    columns = []
    columns.append(ColumnDT('id'))
    columns.append(ColumnDT('name', filter=upper))
    columns.append(ColumnDT('address.description'))
    columns.append(ColumnDT('created_at'))

    # defining the initial query depending on your purpose
    query = DBSession.query(User).join(Address).filter(Address.id > 14)

    # instantiating a DataTable for the query and table needed
    rowTable = DataTables(request.GET, User, query, columns)

    # returns what is needed by DataTable
    return rowTable.output_result()

You can find detailed working examples for Pyramid and Flask in the repository.

Documentation

The latest documentation is available online on Read the Docs.

Changelog

This project adheres to Semantic Versioning. Every release, is documented on the Github releases page.

License

The project is licensed under the MIT license.

sqlalchemy-datatables's People

Contributors

ashl1 avatar bitdeli-chef avatar ddimmich avatar orf avatar pegase745 avatar rodnsi avatar rosickey avatar t2y avatar tdamsma avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.