{ "info": { "author": "leo", "author_email": "leo.anonymous@qq.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "## Flask Records\n\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/flask-records.svg)\n[![Build Status](https://travis-ci.org/1011-1-000/flask-records.svg?branch=master)](https://travis-ci.org/1011-1-000/flask-records)\n\nFlask-Records is an extension that manuiplate the DB with the raw sql for the flask application using records.\n\n### Installation\n\n> pip install flask-records\n\n### Usage\n\n#### Setup\n\nAdd the flask-records to your flask application.\n```python\nfrom flask import Flask\nfrom flask_records import FlaskRecords\n\nraw_db = FlaskRecords(app)\n```\nor initialize the app in the way below:\n```python\nfrom flask import Flask\nfrom flask_records import FlaskRecords\n\nraw_db = FlaskRecords()\nraw_db.init_app(app)\n```\n#### Access DB With Flask Records\n\nWe have provided two decorators for easy using in the development:\n\n##### query\n\nThe basic query decorator you can use in the flask records.\n\n```python\nfrom flask_records.decorator import query\n\n@query(\"INSERT INTO users VALUES(:id, :name, :age)\")\ndef hello_flask_records(id, name, age):\n pass\n\n# call the function: hello_flask_records(1, 'Leo', 27)\n```\n\nalso, you can wrap all the parameters in a dictionary and pass it to the function.\n```python\nfrom flask_records.decorator import query\n\n@query( \"INSERT INTO users VALUES(:id, :name, :age)\")\ndef hello_flask_records(parameters):\n pass\n\n# define a dict which contains the query parameters\n# parameters = {\n# 'id': 1,\n# 'name': 'Leo', \n# 'age': 27\n# }\n# call the function: hello_flask_records(parameters)\n```\n\n##### query_by_page\n\nThis is the decorator which for the pagination.\n\n```python\nfrom flask_records.decorator import query_by_page\n\n@query_by_page(\"SELECT * FROM users\", 2)\ndef hello_flask_records(page):\n pass\n```\n\n### Extra Features\n\nFlask-Records also provide the basic crud function, all you need to do is inherit the RecordsDao when you write the DAO layer classes.\n\n```python\nfrom flask_records import RecordsDao\n\nclass UserDao(RecordsDao):\n\n def __init__(self):\n super(UserDao, self).__init__()\n```\n\nFor detailed instructions on the features, please refer to the flask records documentation.\n\n- [Documentation](https://flask-records.readthedocs.io/en/latest/)", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/1011-1-000/flask-records", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "flask-records", "package_url": "https://pypi.org/project/flask-records/", "platform": "", "project_url": "https://pypi.org/project/flask-records/", "project_urls": { "Homepage": "https://github.com/1011-1-000/flask-records" }, "release_url": "https://pypi.org/project/flask-records/0.0.12/", "requires_dist": null, "requires_python": "", "summary": "Flask wrapper for the SQL Records", "version": "0.0.12" }, "last_serial": 5975384, "releases": { "0.0.12": [ { "comment_text": "", "digests": { "md5": "2af1aaff3863a187f3d247e816b5c8f7", "sha256": "2d2d35242c46f96053a1606021adf327406fb0b3c8a0e6101e919ee93a7daf63" }, "downloads": -1, "filename": "flask_records-0.0.12.tar.gz", "has_sig": false, "md5_digest": "2af1aaff3863a187f3d247e816b5c8f7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5527, "upload_time": "2019-10-15T07:40:47", "url": "https://files.pythonhosted.org/packages/2e/b4/92e6db8ca5bd8ce5c7b954a58ddb9de210c698ce51a8588094a48fc7a2dc/flask_records-0.0.12.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "896bb1b1e97fcaf4988b67f0bf40f80a", "sha256": "b5aca89ce9c6e53acb173d857ff9df92ece8701d892f4d58865229cbd3409d6b" }, "downloads": -1, "filename": "flask_records-0.0.8.tar.gz", "has_sig": false, "md5_digest": "896bb1b1e97fcaf4988b67f0bf40f80a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6622, "upload_time": "2019-10-04T13:04:29", "url": "https://files.pythonhosted.org/packages/33/31/9964570e65574f354341e6affa74aac8550085c8e6b0aaa95df37466cef5/flask_records-0.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2af1aaff3863a187f3d247e816b5c8f7", "sha256": "2d2d35242c46f96053a1606021adf327406fb0b3c8a0e6101e919ee93a7daf63" }, "downloads": -1, "filename": "flask_records-0.0.12.tar.gz", "has_sig": false, "md5_digest": "2af1aaff3863a187f3d247e816b5c8f7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5527, "upload_time": "2019-10-15T07:40:47", "url": "https://files.pythonhosted.org/packages/2e/b4/92e6db8ca5bd8ce5c7b954a58ddb9de210c698ce51a8588094a48fc7a2dc/flask_records-0.0.12.tar.gz" } ] }