Skip to content

Commit

Permalink
Merge pull request #110 from Pegase745/v2
Browse files Browse the repository at this point in the history
Revamp a bit
  • Loading branch information
Pegase745 authored Mar 24, 2019

Verified

This commit was signed with the committer’s verified signature.
2 parents d1e686a + 9f6757d commit 5551871
Showing 48 changed files with 1,659 additions and 1,550 deletions.
4 changes: 0 additions & 4 deletions .bumpversion.cfg

This file was deleted.

111 changes: 88 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,41 +1,106 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
lib
lib64
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.tox
nosetests.xml
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# Mr Developer
.mr.developer.cfg
.project
.pydevproject
# mypy
.mypy_cache/

# Virtualenv folders
local
include
*.sqlite
*.sqlite
22 changes: 12 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -3,19 +3,21 @@ sudo: false
language: python

python:
- "2.7"
- "3.5"
- "pypy"
- "3.6"

install:
- pip install -U pip
- pip install -U setuptools
- pip install .
- pip install faker
- pip install pytest-cov
- make install
- make lint

script:
- py.test --cov=./datatables
script: make test-ci

after_success:
- bash <(curl -s https://codecov.io/bash)

deploy:
provider: pypi
user: $PYPI_USERNAME
password: $PYPI_PASSWORD
on:
branch: master
tags: true
18 changes: 18 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -6,6 +6,24 @@ This project adheres to `Semantic Versioning <http://semver.org/>`_ and `Keep A

Unreleased_
-----------
Removed
~~~~~~~
- `BREAKING` - Drop python 2 support.

Changed
~~~~~~~
- Convert tests to pytest.
- Reorganize code.
- Modernize Flask example.
- Modernize pyramid example.
- Change and apply different linting style.
- Rename .jinja2 templates to .html.
- Update to python 3.6.
- Automatic deploy to Pypi from Travis.

Fixed
~~~~
- Fix DT crash when no `draw` parameter (#98).

1.2.0_ - 2016-12-06
-------------------
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
include *.in
include .bumpversion.cfg
include LICENSE
recursive-include tests *.py
prune bin
prune examples
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.PHONY: all install lint test clean

all: install lint test

install:
pip install -e .[dev]

install-examples:
pip install -e .[examples]

lint:
flake8
isort -rc -c -df **/*.py
yapf -dr datatables/ tests/ examples/

test:
pytest -vx

test-ci:
pytest -qx --cov=datatables

clean:
git clean -dfX
74 changes: 37 additions & 37 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
=================================================================
`sqlalchemy-datatables <http://sqlalchemy-datatables.rtfd.org/>`_
=================================================================

sqlalchemy-datatables is a library providing an `SQLAlchemy <http://www.sqlalchemy.org/>`_ integration of jQuery `DataTables <http://datatables.net/>`_. It helps you manage server side requests in your application.

It is framework agnostic, tested with `Pyramid <http://www.pylonsproject.org/>`_ and `Flask <http://flask.pocoo.org/>`_ mainly.

It only depends on SQLAlchemy, and is compatible with version **1.10.x** of DataTables.
======================
sqlalchemy-datatables
======================

|Build Status| |PyPi Version| |Coverage|

@@ -19,21 +13,45 @@ It only depends on SQLAlchemy, and is compatible with version **1.10.x** of Data
.. |Coverage| image:: https://codecov.io/gh/Pegase745/sqlalchemy-datatables/branch/master/graph/badge.svg
:target: https://codecov.io/gh/Pegase745/sqlalchemy-datatables

sqlalchemy-datatables is a framework agnostic library providing an `SQLAlchemy <http://www.sqlalchemy.org/>`_ integration of jQuery `DataTables <http://datatables.net/>`_ >= 1.10, and helping you manage server side requests in your application.

Installation
------------

To install the stable version:
**To install via pip:**

*Python 2*

.. code-block:: bash
$ pip install sqlalchemy-datatables
*Python 3*

.. code-block:: bash
$ pip3 install sqlalchemy-datatables
**To install from source:**

.. code-block:: bash
pip install sqlalchemy-datatables
$ git clone [email protected]:Pegase745/sqlalchemy-datatables.git
$ cd sqlalchemy-datatables
$ pip install .
**To contribute:**

.. code-block:: bash
In a virtualenv
$ git clone [email protected]:Pegase745/sqlalchemy-datatables.git
$ cd sqlalchemy-datatables
$ make all
Usage
-----

**views.py**

.. code-block:: python
@view_config(route_name='data', renderer='json')
@@ -65,36 +83,18 @@ Usage
# returns what is needed by DataTable
return rowTable.output_result()
Examples
--------

You can find a detailed working example for Pyramid and Flask in the repository, including per column search, and one with the `yadcf <https://github.com/vedmack/yadcf/>`_ plugin.

**Pyramid example:**

.. code-block:: bash
# go to directory
cd sqlalchemy-datatables/examples/pyramid_tut
# install example app
pip install -e .
# initialize the database
initialize_pyramid_tut_db development.ini
# start server
pserve development.ini
# browse to localhost:6543
Documentation
-------------
You can find working examples `in the repository <examples>`_, including an integration with the `yadcf <https://github.com/vedmack/yadcf/>`_ plugin:

The latest documentation is available online on `Read the Docs <http://sqlalchemy-datatables.readthedocs.org/en/latest/>`_.
- `Pyramid example <examples/pyramid_tut/README.rst>`_
- `Flask example <examples/flask_tut/README.rst>`_

Changelog
---------

All notable changes to this project will be documented in `this section <CHANGELOG.rst>`_.
All notable changes to this project will be documented in `this section <https://github.com/Pegase745/sqlalchemy-datatables/releases>`_.

This project adheres to `Semantic Versioning <http://semver.org/>`_ and `Keep A Changelog <http://keepachangelog.com/>`_.

30 changes: 0 additions & 30 deletions bin/release

This file was deleted.

Loading

0 comments on commit 5551871

Please sign in to comment.