{ "info": { "author": "Martin Aspeli", "author_email": "optilude@gmx.net", "bugtrack_url": null, "classifiers": [ "Framework :: Zope2", "Framework :: Zope3", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Introduction\n============\n\nThe lead part of the alchemist's toolkit.\n\nYes, it's Yet Another SQLAlchemy/Zope Integration Package. I'm sorry,\nI really am. Many thanks to Andreas Jung for z3c.sqlalchemy and Kapil \nThangavelu for ore.alchemist. I borrowed the Zope transaction data\nmanager code from Andreas who borrowed it from Kapil, I believe.\n\nThe purpose of this package is to be the lead part and the lead part only.\nThe gold-making bit is left to SQLAlchemy. That means that are no \nabstractions or lazy initialisaion or table auto-detection for building \nSQLAlchemy table metadata and mappers, no generation of Zope 3 interfaces,\nno CRUD operations, and no dancing polar bears.\n\nYou need to understand SQLAlchemy for this package and this README to make \nany sense. See http://sqlalchemy.org/docs/.\n\nPlease note that this package is only meant to be used as a tool in other\npackages; you can not install it directly in a Zope site.\n\n\nThe use case\n------------\n\n - You want SQLAlchemy\n \n - You want to look up database connections/sessions as named utilities\n \n - You want to use simple domain/mapper classes, with no particular \n dependencies\n \n - You don't want to worry about transaction and connection handling\n \n - You want to be able to configure SQL connection parameters at run-time,\n e.g. in the ZODB. Well, you don't have to, but it's nice to have the\n option.\n\nWhat you have to do\n-------------------\n\nLet's say we had some domain classes TableOne and TableTwo, relating to tables\ntable1 and table2.\n\n >>> class TableOne(object):\n ... pass\n >>> class TableTwo(object):\n ... pass\n\nYou are supposed to subclass collective.lead.Database, fill in its template\nmethods, and then register the new class as a global, non-persistent\nnamed utility providing IDatabase.\n\n >>> from collective.lead import Database\n >>> import sqlalchemy as sa\n\n >>> class MyDatabase(Database):\n ... @property\n ... def _url(self):\n ... return sa.engine.url.URL(drivername='mysql', username='user',\n ... host='localhost', database='testdb')\n ...\n ... def _setup_tables(self, metadata, tables):\n ... tables['table1'] = sa.Table('table1', metadata, autoload=True)\n ... tables['table2'] = sa.Table('table2', metadata, autoload=True)\n ... \n ... def _setup_mappers(self, tables, mappers):\n ... mappers['table1'] = sa.mapper(TableOne, tables['table1'])\n ... mappers['table2'] = sa.mapper(TableTwo, tables['table2'],\n ... properties = {\n ... 'table1' : sa.relation(TableOne),\n ... })\n \n\nThe database utility can now be registered using zcml:\n\n \n\nor if you prefer directly from python (XXX this does not work):\n\n >>> from zope.component import provideUtility\n >>> from collective.lead.interfaces import IDatabase\n >>> provideUtility(MyDatabase, name='my.database', provides=IDatabase)\n\nUsing the database connection\n-----------------------------\n\nIn application code, you can now get a database engine by name. This engine\nis threadlocal, and contains a single, cached session. When it is first\nrequested, a new transaction will be begun. This is joined to a Zope\ntransaction, and will commit or roll back as appropriate when the request\nends. Or, in other words, it should work more or less as you'd expect and\nyou should not need to worry about transactions (neither Zope nor SQL ones).\n\n >>> from zope.component import getUtility\n >>> db = getUtility(IDatabase, name='my.database')\n >>> db.session.query(TableOne).list()\n []\n \n >>> db.connection.execute(\"SELECT * FROM table1\")\n\n \n\nChangelog\n=========\n\n1.0 - unreleased\n----------------\n\n- Initial release\n [optilude]", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://svn.plone.org/svn/collective/collective.lead", "keywords": "", "license": "LGPL", "maintainer": null, "maintainer_email": null, "name": "collective.lead", "package_url": "https://pypi.org/project/collective.lead/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/collective.lead/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://svn.plone.org/svn/collective/collective.lead" }, "release_url": "https://pypi.org/project/collective.lead/1.0/", "requires_dist": null, "requires_python": null, "summary": "SQLAlchemy/Zope2 transaction integration", "version": "1.0" }, "last_serial": 787927, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "f634165e7b3ec0a12fef0da6a3bc8875", "sha256": "01ae5271cea0d1397a8948f07768fea21cbe1e1bbf0567bcd09249ea375e55a8" }, "downloads": -1, "filename": "collective.lead-1.0-py2.4.egg", "has_sig": false, "md5_digest": "f634165e7b3ec0a12fef0da6a3bc8875", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 18936, "upload_time": "2008-04-27T22:24:16", "url": "https://files.pythonhosted.org/packages/c4/63/aa1e3b29fbfe370a25133a2f1cc22958877d16fff2dbae87fda73ef171a5/collective.lead-1.0-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "89aa46212909d108ab764f297477bfaf", "sha256": "da5ca3912a72943282f7bf41351762cc67ca7e9ef96634bee7e9ec2455717b6a" }, "downloads": -1, "filename": "collective.lead-1.0-py2.5.egg", "has_sig": false, "md5_digest": "89aa46212909d108ab764f297477bfaf", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 18873, "upload_time": "2008-04-27T22:23:21", "url": "https://files.pythonhosted.org/packages/55/0f/2915f01ac154b4884d734f6bc3ac600f21d852f6a98edca38eeb0bf11138/collective.lead-1.0-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "141ff4e636dc6d7484faf7b3859e21c9", "sha256": "1c0d15c0e58464d366a385045abab6a140a6c1c9c8092fc246b508cfc411fa3b" }, "downloads": -1, "filename": "collective.lead-1.0.tar.gz", "has_sig": false, "md5_digest": "141ff4e636dc6d7484faf7b3859e21c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12518, "upload_time": "2008-04-27T22:23:21", "url": "https://files.pythonhosted.org/packages/10/4d/cda769165d73db62465ff86e715b1b720514a227aa6060e3ab5403e714c2/collective.lead-1.0.tar.gz" } ], "1.0b1": [ { "comment_text": "", "digests": { "md5": "c2ccce71ef458b87abf491cb56edbb7d", "sha256": "d38512eda0d1a934043e89c82cd50b499896f0ad9b1a757208a7830ca0fc4b6b" }, "downloads": -1, "filename": "collective.lead-1.0b1-py2.4.egg", "has_sig": false, "md5_digest": "c2ccce71ef458b87abf491cb56edbb7d", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 13839, "upload_time": "2007-05-02T22:35:35", "url": "https://files.pythonhosted.org/packages/71/e6/1f023ee3bfbb934371d035bf2e2d3cbb7b45380e93dba2fa3e78f37b522e/collective.lead-1.0b1-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "211c83de123d5aa84fb57c7439f65b4b", "sha256": "7a967d6659307589754a58b1a612d7557dc4e8de25b00683e03d0d5127d634db" }, "downloads": -1, "filename": "collective.lead-1.0b1.tar.gz", "has_sig": false, "md5_digest": "211c83de123d5aa84fb57c7439f65b4b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12067, "upload_time": "2007-05-02T22:35:34", "url": "https://files.pythonhosted.org/packages/0d/24/60f7810f9bbb76c2058f54f468bbe1730600d0c629f5b81d866b0dd1a9c5/collective.lead-1.0b1.tar.gz" } ], "1.0b2": [ { "comment_text": "", "digests": { "md5": "3cf7fe1a99140c16a84ddad9d430d323", "sha256": "e44015b7db74dfbc7a71fdfa049373d1626b7f7865e5107247c408363b6f0a22" }, "downloads": -1, "filename": "collective.lead-1.0b2-py2.4.egg", "has_sig": false, "md5_digest": "3cf7fe1a99140c16a84ddad9d430d323", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 14024, "upload_time": "2007-05-04T19:24:32", "url": "https://files.pythonhosted.org/packages/1e/59/b6f3a910f0c2db1c51028e1ad841e23cc82e806d109ca3fe0575d6f0b764/collective.lead-1.0b2-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "b8afd6c576309f201944107da6f74caa", "sha256": "d49947fa0ec1a9b64102e7450a165b9ca3e9e676d3e91e44a2ca6018a8be49ef" }, "downloads": -1, "filename": "collective.lead-1.0b2.tar.gz", "has_sig": false, "md5_digest": "b8afd6c576309f201944107da6f74caa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11519, "upload_time": "2007-05-04T19:24:31", "url": "https://files.pythonhosted.org/packages/91/d3/6432c93eeaf8f6cea59f8605bd54d75b42adfd8d4b9916778286973deff6/collective.lead-1.0b2.tar.gz" } ], "1.0b3": [ { "comment_text": "", "digests": { "md5": "2d643ecb5e8f5a98c98f129354ecfa5b", "sha256": "34fb3de0cc6eec39b6d0cb1439cb922a38f1f455a35ddc7c1dac87a0e691522c" }, "downloads": -1, "filename": "collective.lead-1.0b3-py2.4.egg", "has_sig": false, "md5_digest": "2d643ecb5e8f5a98c98f129354ecfa5b", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 14034, "upload_time": "2007-06-05T21:41:27", "url": "https://files.pythonhosted.org/packages/66/da/de00ac92685a0c82486aee7b8593e64f01c1e9459c2b827ecfd1257de241/collective.lead-1.0b3-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "deda6a2195332546c0bbe860dde40195", "sha256": "b6473115ce8c7d570478779395a71bfb4d745d683efa3c4e608ab83f6f6a4bef" }, "downloads": -1, "filename": "collective.lead-1.0b3.tar.gz", "has_sig": false, "md5_digest": "deda6a2195332546c0bbe860dde40195", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11532, "upload_time": "2007-06-05T21:41:18", "url": "https://files.pythonhosted.org/packages/c5/a1/8cfb4bf2dc3f918923bdaa7aabbaf7e1960a69277b9f04530317a0b08b0b/collective.lead-1.0b3.tar.gz" } ], "1.0rc1": [ { "comment_text": "", "digests": { "md5": "c09e71401e345ad21b696935d2dd49ec", "sha256": "40badcc5e355415d041a2e7a3e889763f2706a7e974a2ded9bcea626906ef82f" }, "downloads": -1, "filename": "collective.lead-1.0rc1-py2.4.egg", "has_sig": false, "md5_digest": "c09e71401e345ad21b696935d2dd49ec", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 14099, "upload_time": "2007-08-20T00:40:56", "url": "https://files.pythonhosted.org/packages/ba/23/eea8cc2a65cfb749e4ad1c5b44cec1080d8b1f5fb6b04903e42ecd4e0228/collective.lead-1.0rc1-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "9d7dbd3c4c9ceecb18f8c2a377872d47", "sha256": "95227b4cc75cab99dd82930bb7c9056915cb753f1226afcea6817857dc631418" }, "downloads": -1, "filename": "collective.lead-1.0rc1.tar.gz", "has_sig": false, "md5_digest": "9d7dbd3c4c9ceecb18f8c2a377872d47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11607, "upload_time": "2007-08-20T00:40:56", "url": "https://files.pythonhosted.org/packages/d8/ff/19dc0b902ae8b59cad5f5e20ed91e9c3f7a2f3eb58d5bb6ed6af5389b3cc/collective.lead-1.0rc1.tar.gz" } ], "1.0rc2": [ { "comment_text": "", "digests": { "md5": "2b7f69aeab547ca17823b49f9ce5b84a", "sha256": "9ada83743adaca7c4209c127340779f18010a31e5f370c6a7ae3a4083c6e537f" }, "downloads": -1, "filename": "collective.lead-1.0rc2-py2.4.egg", "has_sig": false, "md5_digest": "2b7f69aeab547ca17823b49f9ce5b84a", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 14223, "upload_time": "2007-09-09T00:17:14", "url": "https://files.pythonhosted.org/packages/60/5f/13d04b9a008639d18e2241e2fd2dfa715adbe6f23f30f597f397adaa4284/collective.lead-1.0rc2-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "5874ae334a476530577fb4d386deca50", "sha256": "e5f77d1a6d1c544062498f536451e13d1acecdc73ac74ca36c11a49f396f60e7" }, "downloads": -1, "filename": "collective.lead-1.0rc2.tar.gz", "has_sig": false, "md5_digest": "5874ae334a476530577fb4d386deca50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11671, "upload_time": "2007-09-09T00:17:14", "url": "https://files.pythonhosted.org/packages/ee/02/426fc07a9f8ce709a18784b2695c705f8afaea61c6a8539849d1e39442f6/collective.lead-1.0rc2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f634165e7b3ec0a12fef0da6a3bc8875", "sha256": "01ae5271cea0d1397a8948f07768fea21cbe1e1bbf0567bcd09249ea375e55a8" }, "downloads": -1, "filename": "collective.lead-1.0-py2.4.egg", "has_sig": false, "md5_digest": "f634165e7b3ec0a12fef0da6a3bc8875", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 18936, "upload_time": "2008-04-27T22:24:16", "url": "https://files.pythonhosted.org/packages/c4/63/aa1e3b29fbfe370a25133a2f1cc22958877d16fff2dbae87fda73ef171a5/collective.lead-1.0-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "89aa46212909d108ab764f297477bfaf", "sha256": "da5ca3912a72943282f7bf41351762cc67ca7e9ef96634bee7e9ec2455717b6a" }, "downloads": -1, "filename": "collective.lead-1.0-py2.5.egg", "has_sig": false, "md5_digest": "89aa46212909d108ab764f297477bfaf", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 18873, "upload_time": "2008-04-27T22:23:21", "url": "https://files.pythonhosted.org/packages/55/0f/2915f01ac154b4884d734f6bc3ac600f21d852f6a98edca38eeb0bf11138/collective.lead-1.0-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "141ff4e636dc6d7484faf7b3859e21c9", "sha256": "1c0d15c0e58464d366a385045abab6a140a6c1c9c8092fc246b508cfc411fa3b" }, "downloads": -1, "filename": "collective.lead-1.0.tar.gz", "has_sig": false, "md5_digest": "141ff4e636dc6d7484faf7b3859e21c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12518, "upload_time": "2008-04-27T22:23:21", "url": "https://files.pythonhosted.org/packages/10/4d/cda769165d73db62465ff86e715b1b720514a227aa6060e3ab5403e714c2/collective.lead-1.0.tar.gz" } ] }