{ "info": { "author": "Eric Larson", "author_email": "eric@ionrock.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4" ], "description": "===================\nCherryPy-SQLAlchemy\n===================\n\n..\n .. image:: https://badge.fury.io/py/cp_sqlalchemy.png\n :target: http://badge.fury.io/py/cp_sqlalchemy\n\n .. image:: https://travis-ci.org/ionrock/cp_sqlalchemy.png?branch=master\n\t :target: https://travis-ci.org/ionrock/cp_sqlalchemy\n\n .. image:: https://pypip.in/d/cp_sqlalchemy/badge.png\n\t :target: https://pypi.python.org/pypi/cp_sqlalchemy\n\n\nCherryPy-SQLAlchemy makes it easy to use SQLAlchemy within CherryPy\napps.\n\n\nCredits\n=======\n\nThis package was primarily created from `Sylvain's SQLAlchemy\nrecipe\n`_.\n\n\nBasic Usage\n===========\n\nThere are two elements of CherryPy-SQLAlchemy\n\n 1. A CherryPy tool that will create a session for use with each\n request.\n 2. A CherryPy plugin that can maintains information about the\n database and binds the session to the specific DB.\n\nHere is an example connecting to a sqlite db: ::\n\n import cherrypy\n\n from app import Root\n from app.models import ORMBase\n from cp_sqlalchemy import SQLAlchemyTool, SQLAlchemyPlugin\n\n\n def run():\n cherrypy.tools.db = SQLAlchemyTool()\n cherrypy.tree.mount(Root(), '/', {\n '/': {\n\t 'tools.db.on': True\n\t }\n })\n\n SQLAlchemyPlugin(\n cherrypy.engine, ORMBase, 'sqlite:////path/to/file.db'\n )\n\n cherrypy.engine.start()\n cherrypy.engine.block()\n\n\nOne thin to note is the ORMBase we imported is\n`sqlalchemy.ext.declarative.declarative_base()` that was used when\ncreating models.\n\nFrom there, each request will have access to `cherrypy.request.db`,\nwhich is an instance of a SQLAlchemy session.\n\nThere is a more complete `example.py` in the source.\n\n\n* Free software: BSD license\n* Documentation: https://cp_sqlalchemy.readthedocs.org.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ionrock/cp_sqlalchemy", "keywords": "cp_sqlalchemy", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "cp_sqlalchemy", "package_url": "https://pypi.org/project/cp_sqlalchemy/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/cp_sqlalchemy/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/ionrock/cp_sqlalchemy" }, "release_url": "https://pypi.org/project/cp_sqlalchemy/0.5.1/", "requires_dist": null, "requires_python": null, "summary": "Use SQLAlchemy with CherryPy", "version": "0.5.1" }, "last_serial": 1378977, "releases": { "0.5.1": [ { "comment_text": "", "digests": { "md5": "bc1c1ac037164c73a51c146c5348762a", "sha256": "894f0de45202d0981cf0647c73fe5e07e6b7fcf484ad972a8e4a506a7a39e810" }, "downloads": -1, "filename": "cp_sqlalchemy-0.5.1.tar.gz", "has_sig": false, "md5_digest": "bc1c1ac037164c73a51c146c5348762a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3447, "upload_time": "2015-01-12T04:04:32", "url": "https://files.pythonhosted.org/packages/10/8b/f60653db3743821661cc208170c57c409c97600e918c093d24cd45baad11/cp_sqlalchemy-0.5.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bc1c1ac037164c73a51c146c5348762a", "sha256": "894f0de45202d0981cf0647c73fe5e07e6b7fcf484ad972a8e4a506a7a39e810" }, "downloads": -1, "filename": "cp_sqlalchemy-0.5.1.tar.gz", "has_sig": false, "md5_digest": "bc1c1ac037164c73a51c146c5348762a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3447, "upload_time": "2015-01-12T04:04:32", "url": "https://files.pythonhosted.org/packages/10/8b/f60653db3743821661cc208170c57c409c97600e918c093d24cd45baad11/cp_sqlalchemy-0.5.1.tar.gz" } ] }