jquery数据表的sqlalchemy集成

sqlalchemy-datatables的Python项目详细描述


Build StatusPyPi VersionScrutinizerCoverage

sqlalchemy datatables是一个与框架无关的库,它提供jqueryDataTables>;=1.10的SQLAlchemy集成,并帮助您管理应用程序中的服务器端请求。

安装

通过pip安装:

python 3

$ pip3 install sqlalchemy-datatables

从源安装:

$ git clone git@github.com:Pegase745/sqlalchemy-datatables.git
$ cd sqlalchemy-datatables
$ pip3 install .

供款:

In a virtualenv
$ git clone git@github.com:Pegase745/sqlalchemy-datatables.git
$ cd sqlalchemy-datatables
$ make all

用法

@view_config(route_name='data',renderer='json')defdata(request):"""Return server side data."""# defining columns#  - explicitly cast date to string, so string searching the date#    will search a date formatted equal to how it is presented#    in the tablecolumns=[ColumnDT(User.id),ColumnDT(User.name),ColumnDT(Address.description),ColumnDT(func.strftime('%d-%m-%Y',User.birthday)),ColumnDT(User.age)]# defining the initial query depending on your purpose#  - don't include any columns#  - if you need a join, also include a 'select_from'query=DBSession.query().\
        select_from(User).\
        join(Address).\
        filter(Address.id>4)# instantiating a DataTable for the query and table neededrowTable=DataTables(request.GET,query,columns)# returns what is needed by DataTablereturnrowTable.output_result()

示例

您可以找到工作示例in the repository,包括与yadcf插件的集成:

更改日志

该项目的所有显著更改都将记录在this section中。

这个项目遵循Semantic VersioningKeep A Changelog

许可证

这个项目是根据麻省理工学院的许可证授权的。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在Android Wifi中筛选相同的SSID?   Java中重写接口中异常处理的泛型   java“无效转义序列(有效的是\b\t\n\f\r\”\“\”\)”语法错误   使用JNDI的java NameReadyBoundException   java如何在这个程序上执行算法   java为什么我的应用程序在调试时崩溃而应用程序停止?   Java:while循环未检测到中断条件,但如果块检测到   java如何快速使用jfreechart创建的折线图   java将输入放入JSTL会话变量,以便稍后在屏幕上显示   java在spring boot中加载外部JAR   java Apache NiFi无法使用ojdbc6连接到Oracle 12c。jar或ojdbc8。罐子   java解释StringToWordVector()Weka的输出   java charAt()找不到符号   使用mpjexpress的java阅读控制台输入