A useful simple to use tool to turn your sql query into a beautiful report html table
Project description
This is easy to use tool for generating html table from sql query.
the package contains only one function named "generateFromSql" with 8 arguments :
- session : SQLAlchemy session
- title : the title of the report that will be shown on top of table
- sqltext : the sql query
- footerCols : a list of columns name that you want to have Sum of values on footer . Example : ['amount','price']
- direction (default = "ltr") : indicates direction of the report page. "ltr"- Left to Right , "rtl" - Right to Left
- font (default = "Tahoma") : font of title and table contents
- totalText (default = "Total") : title of footer row that will be the put below the first column.
- rowIndex (default = False) : indicates whether the table should have index column or not.
- headerRowColor (default = '#eeeeee') : the header (title) row background color.
- evenRowColor (default = '#ffffff') : the even rows background color.
- oddRowColor (default = '#ffffff') : the odd rows background color.
usage :
<<<<<<< HEAD
Installation
To install flask_sqlalchemy using pip type:
pip install flask-sqlalchemy-report
Usage :
=======
pip install flask-sqlalchemy-report
da9569e7d358dd7f72e42a48d3c494dd276877b0
from flask_sqlalchemy_report import Reporter
@app.route('/listOfPersons', methods=['GET'])
def listOfPersons():
<<<<<<< HEAD
return Reporter.generateFromSql(db.session, "Employee List","SELECT FirstName as 'First Name', LastName as 'Last Name', phone as 'Phone Number', salary as 'Salary' FROM persons", ['Salary'], "rtl", "Arial", "Total Salary", True,'#ffeeee','#ffeeff','#ffffff')
=======
return Reporter.generateFromSql(db.session, "Employee List","SELECT FirstName as 'First Name', LastName as 'Last Name', phone as 'Phone Number', salary as 'Salary' FROM persons", ['Salary'], "rtl", "Arial", "Total Salary", True)
>>>>>>> da9569e7d358dd7f72e42a48d3c494dd276877b0
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for flask_sqlalchemy_report-0.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | af0816c6ace1a034a183e82fe50e9b1565f78e981eaa94f030228e83f1bc09d9 |
|
MD5 | 77a420a7e4f1c68b791cf948bf1fa099 |
|
BLAKE2b-256 | 2166ab57593d630dfa2e186d299dd645648079cc23adbd213fd74a4c3c94de7e |
Close
Hashes for flask_sqlalchemy_report-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5c57b4d4a9bd8afdb356364cf88f49b3bd2744254dcc588949c353e7055ea09 |
|
MD5 | 718192613b9962095ccf58bea64e6743 |
|
BLAKE2b-256 | 5cffd8607cdc9242df86e79474a4e1f36203e2cb2e1f21bfa77e61b0d0fe0152 |