{ "info": { "author": "Mingcai SHEN", "author_email": "archsh@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "tg2ext.express\n==============\n\nThis is a CRUD controller which helps you to exposure your database tables via a HTTP RESTful interface quickly on TurboGears2,\nhelps you make your WEB pages access your database quickly via Ajax.\n\n# For example\n\n## With the following code in your TG app:\n\n from tg2ext.express import ExpressController\n\n class Writer(DeclarativeBase):\n __tablename__ = 'db_writers'\n #{ Columns\n id = Column(Integer, primary_key=True)\n firstname = Column(Unicode(64), nullable=False)\n lastname = Column(Unicode(64), nullable=False)\n gender = Column(Enum('Male', 'Female', name='wrtier_gender'), default='Male')\n birthday = Column(Date, nullable=True)\n description = Column(Text, nullable=True)\n created = Column(DateTime, default=func.NOW())\n #}\n fullname = column_property(firstname + \" \" + lastname)\n\n\n class Article(DeclarativeBase):\n __tablename__ = 'db_articles'\n\n #{ Columns\n id = Column(Integer, primary_key=True)\n title = Column(Unicode(256), nullable=False)\n keys = Column(Unicode(256), nullable=True)\n content = Column(Text, nullable=True)\n writer_id = Column(Integer, ForeignKey('db_writers.id'), nullable=False)\n created = Column(DateTime, default=func.NOW())\n #}\n writer = relation('Writer', backref='articles')\n\n\n class Comment(DeclarativeBase):\n __tablename__ = 'db_comments'\n #{ Columns\n id = Column(Integer, primary_key=True)\n comment = Column(Unicode(256), nullable=False)\n article_id = Column(Integer, ForeignKey('db_articles.id'), nullable=False)\n created = Column(DateTime, default=func.NOW())\n #}\n db_articles = relation('Article', backref='comments')\n\n class RootController(BaseController):\n # ...\n writer = ExpressController(model=model.Writer, dbsession=DBSession)\n article = ExpressController(model=model.Article, dbsession=DBSession)\n comment = ExpressController(model=model.Comment, dbsession=DBSession)\n\n # ...\n\n## You will get your HTTP APIs for access writers, articles, comments:\n\n### Writers:\n /writer/{$id|_schema|_aggregate}[?query&controles]\n### Articles:\n /article/{$id|_schema|_aggregate}[?query&controles]\n### Comments:\n /comment/{$id|_schema|_aggregate}[?query&controles]\n\n### For get articles with writer_id==2:\n\nGET /article/?writer_id=2&__include_fields=title,keys,created&__extend_fields=writer.firstname,writer.lastname\n\n {\n \"__count\": 2,\n \"__limit\": 50,\n \"__model\": \"Article\",\n \"__ref\": \"/article/\",\n \"Article\": [\n {\n \"keys\": \"note,another\",\n \"writer\": {\n \"lastname\": \"SHEN\",\n \"id\": 2,\n \"firstname\": \"Fangze\"\n },\n \"title\": \"Test note2\",\n \"id\": 3,\n \"created\": \"2014-02-26 13:36:18\"\n },\n {\n \"keys\": \"test\",\n \"writer\": {\n \"lastname\": \"SHEN\",\n \"id\": 2,\n \"firstname\": \"Fangze\"\n },\n \"title\": \"Test note4\",\n \"id\": 4,\n \"created\": \"2014-02-26 13:36:18\"\n }\n ],\n \"__begin\": 0,\n \"__total\": 2\n }\n\n### For getting writer table schema:\n\nGET /writer/_schema\n\n {\n \"relationships\": {\n \"articles\": {\n \"field\": [\n \"db_articles.writer_id\"\n ],\n \"direction\": \"ONETOMANY\",\n \"target\": \"Article\"\n }\n },\n \"table\": \"Writer\",\n \"fields\": {\n \"description\": {\n \"primary_key\": false,\n \"nullable\": true,\n \"default\": null,\n \"doc\": null,\n \"unique\": null,\n \"type\": \"TEXT\"\n },\n \"firstname\": {\n \"primary_key\": false,\n \"nullable\": false,\n \"default\": null,\n \"doc\": null,\n \"unique\": null,\n \"type\": \"VARCHAR(64)\"\n },\n \"created\": {\n \"primary_key\": false,\n \"nullable\": true,\n \"default\": \"ColumnDefault()\",\n \"doc\": null,\n \"unique\": null,\n \"type\": \"DATETIME\"\n },\n \"lastname\": {\n \"primary_key\": false,\n \"nullable\": false,\n \"default\": null,\n \"doc\": null,\n \"unique\": null,\n \"type\": \"VARCHAR(64)\"\n },\n \"birthday\": {\n \"primary_key\": false,\n \"nullable\": true,\n \"default\": null,\n \"doc\": null,\n \"unique\": null,\n \"type\": \"DATE\"\n },\n \"gender\": {\n \"primary_key\": false,\n \"nullable\": true,\n \"default\": \"ColumnDefault('Male')\",\n \"doc\": null,\n \"unique\": null,\n \"type\": \"VARCHAR(6)\"\n },\n \"id\": {\n \"primary_key\": true,\n \"nullable\": false,\n \"default\": null,\n \"doc\": null,\n \"unique\": null,\n \"type\": \"INTEGER\"\n }\n }\n }\n\n### For aggregations:\n\nGET /article/_aggregate?__count=id&__group_by=writer_id\n\n {\n \"__count\": 2,\n \"__model\": \"Article\",\n \"__ref\": \"/article/_aggregate\",\n \"__type\": \"Aggregation\",\n \"Article\": [\n {\n \"__count_id\": 2,\n \"writer_id\": 1\n },\n {\n \"__count_id\": 2,\n \"writer_id\": 2\n }\n ],\n \"__total\": 2\n }\n\n# HTTP API:\n\n### Controle Params:\n\n __begin:\n __limit:\n __include_fields:\n __extend_fields:\n\n### Query Lookups: ${field_name}__${lookup}=${value(s)}\n\n not\n contains\n startswith\n endswith\n in\n range\n lt\n lte\n gt\n gte\n year\n month\n day\n hour\n minute\n dow\n\n### Aggregation functions:\n\n __count:\n __sum:\n __avg:\n __min:\n __max:", "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/archsh/tg2ext.express", "keywords": null, "license": "The MIT License (MIT)", "maintainer": null, "maintainer_email": null, "name": "tg2ext.express", "package_url": "https://pypi.org/project/tg2ext.express/", "platform": "any", "project_url": "https://pypi.org/project/tg2ext.express/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/archsh/tg2ext.express" }, "release_url": "https://pypi.org/project/tg2ext.express/0.3.0/", "requires_dist": null, "requires_python": null, "summary": "tg2ext.express, a small extension for TurboGears2", "version": "0.3.0" }, "last_serial": 1112179, "releases": { "0.2.10": [ { "comment_text": "", "digests": { "md5": "320b5f66c7f6cb9c71067c8dfaf4c475", "sha256": "f8b9904260843c7a38d8a570a430c511dc4fe1be82c23dfaaed739531db11596" }, "downloads": -1, "filename": "tg2ext.express-0.2.10.tar.gz", "has_sig": false, "md5_digest": "320b5f66c7f6cb9c71067c8dfaf4c475", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12450, "upload_time": "2014-04-01T03:48:19", "url": "https://files.pythonhosted.org/packages/39/87/58deb746993851945f335e1a1ae5afdd7717e11377c78dc73cdbd3dbbc3f/tg2ext.express-0.2.10.tar.gz" } ], "0.2.12": [ { "comment_text": "", "digests": { "md5": "d2619ef628559432a71a4cc046939176", "sha256": "b34ca7bf84412787b7b5e523d2bd90f72e8b3cd3b5e8ff029ed91f68d0534dd9" }, "downloads": -1, "filename": "tg2ext.express-0.2.12.tar.gz", "has_sig": false, "md5_digest": "d2619ef628559432a71a4cc046939176", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12526, "upload_time": "2014-04-21T13:51:50", "url": "https://files.pythonhosted.org/packages/54/41/61399478ad7ae50b8bc5f507f90beff00cdff3d93d257a17581db5f5a9c6/tg2ext.express-0.2.12.tar.gz" } ], "0.2.13": [ { "comment_text": "", "digests": { "md5": "880ca07dcb82b10dbbc8783662cd9cfc", "sha256": "d2c0a1d291b212531f516cd934c3be81d945a0f20ab501bb06b39d294a3aae49" }, "downloads": -1, "filename": "tg2ext.express-0.2.13.tar.gz", "has_sig": false, "md5_digest": "880ca07dcb82b10dbbc8783662cd9cfc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12653, "upload_time": "2014-05-13T07:06:07", "url": "https://files.pythonhosted.org/packages/a7/fe/b2ace528025556f0a1e88d3576da2f142e145cce34ac8255a67c22cc1024/tg2ext.express-0.2.13.tar.gz" } ], "0.2.14": [ { "comment_text": "", "digests": { "md5": "0a84b5097e988787d0f79cdb8a5b4727", "sha256": "2ba3b2bfd63e66a000d557bd8f21e3cb01888849fa467d76f0b015e7fa3d9a95" }, "downloads": -1, "filename": "tg2ext.express-0.2.14.tar.gz", "has_sig": false, "md5_digest": "0a84b5097e988787d0f79cdb8a5b4727", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13171, "upload_time": "2014-05-14T08:33:32", "url": "https://files.pythonhosted.org/packages/1a/5e/d42da8af5fe81e8938b5558136149816e630b5222e6925fd07b091004036/tg2ext.express-0.2.14.tar.gz" } ], "0.2.15": [ { "comment_text": "", "digests": { "md5": "ec4b8da64b8e675da1556156ee865f4c", "sha256": "f97daf18e24ec0b3a7744fda9ebd0d450095c63ac9f45d8ac871b9e6ec8fb512" }, "downloads": -1, "filename": "tg2ext.express-0.2.15.tar.gz", "has_sig": false, "md5_digest": "ec4b8da64b8e675da1556156ee865f4c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13172, "upload_time": "2014-05-14T10:20:11", "url": "https://files.pythonhosted.org/packages/ca/6e/a11056bed2b68c4eb75e059a5ecf08b082a5da4f08ce574cfa5f76cbd60a/tg2ext.express-0.2.15.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "cb807b33c760c762180a1d08aaeeedb7", "sha256": "18c8e006cd701a957adc9ae4e3c464eaeddc522de62b3f5f6c885eac98d37425" }, "downloads": -1, "filename": "tg2ext.express-0.2.3.tar.gz", "has_sig": false, "md5_digest": "cb807b33c760c762180a1d08aaeeedb7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11623, "upload_time": "2014-03-08T08:15:09", "url": "https://files.pythonhosted.org/packages/23/b5/09884db378ed9221282cdd63a4c5b341e317dcd24a39ffec853953ef6fea/tg2ext.express-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "f2e056709cac6600ae783728770366c9", "sha256": "ffe193d4cb03dc298a748ed110bb01ce3eb0d283eee1a347b85a24bcd24ad0f5" }, "downloads": -1, "filename": "tg2ext.express-0.2.4.tar.gz", "has_sig": false, "md5_digest": "f2e056709cac6600ae783728770366c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11718, "upload_time": "2014-03-13T02:14:45", "url": "https://files.pythonhosted.org/packages/ed/4a/47538fce059576e99f78f7fb7339482a424071c22c88241cfc94bfc26a76/tg2ext.express-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "28476cfc81772f9e801e4ff340e9188e", "sha256": "e66814d7df0394962b101c5a137532d27a44bf570d9f771c26673d3fcb834d44" }, "downloads": -1, "filename": "tg2ext.express-0.2.5.tar.gz", "has_sig": false, "md5_digest": "28476cfc81772f9e801e4ff340e9188e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11788, "upload_time": "2014-03-13T02:27:35", "url": "https://files.pythonhosted.org/packages/04/f1/e45f1b12b304fffad650d1e783d187d3b9e51e778cad3196dc712e1f1db9/tg2ext.express-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "a1dbcca5763b049a9521c370c2c7d43a", "sha256": "8db559b755f1d3582d9e72de4d6cd80d7093c82be993c0cc16d35721e642703a" }, "downloads": -1, "filename": "tg2ext.express-0.2.6.tar.gz", "has_sig": false, "md5_digest": "a1dbcca5763b049a9521c370c2c7d43a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11833, "upload_time": "2014-03-13T04:10:08", "url": "https://files.pythonhosted.org/packages/0a/49/1bf394697e89c6a7917c2a44b32bb6feb63c16ef41f3399f45515bb7f2ec/tg2ext.express-0.2.6.tar.gz" } ], "0.2.7": [ { "comment_text": "", "digests": { "md5": "24b280338fea83cedbc1c364183be181", "sha256": "41faac880a4e8542bf4f2e016fa2a1ddcbc4286c83b5d8c77690266b467e6c85" }, "downloads": -1, "filename": "tg2ext.express-0.2.7.tar.gz", "has_sig": false, "md5_digest": "24b280338fea83cedbc1c364183be181", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12011, "upload_time": "2014-03-21T03:45:12", "url": "https://files.pythonhosted.org/packages/a3/be/530626dcf9a2195c153ea688476fec67465756bc647f5c27b75d9bcf7292/tg2ext.express-0.2.7.tar.gz" } ], "0.2.8": [ { "comment_text": "", "digests": { "md5": "e936d1b7802ca73bdf4b3068cedeba48", "sha256": "db1989a031c6a39192d6f91a19855b2593e7fecc57e0262c55c511212c7c9a91" }, "downloads": -1, "filename": "tg2ext.express-0.2.8.tar.gz", "has_sig": false, "md5_digest": "e936d1b7802ca73bdf4b3068cedeba48", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12226, "upload_time": "2014-03-25T01:46:58", "url": "https://files.pythonhosted.org/packages/21/3a/dfd6160f6315bbe85080ad7c2fcc0b3cb192058b0bae381ecd9973979181/tg2ext.express-0.2.8.tar.gz" } ], "0.2.9": [ { "comment_text": "", "digests": { "md5": "0a92b1c93637b024fb537c2b9369e145", "sha256": "d3758994b3d3633e34c3b2d58f8d334be5b95ac6877b066d7dc9d15d8788ce50" }, "downloads": -1, "filename": "tg2ext.express-0.2.9.tar.gz", "has_sig": false, "md5_digest": "0a92b1c93637b024fb537c2b9369e145", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12457, "upload_time": "2014-04-01T01:24:40", "url": "https://files.pythonhosted.org/packages/42/6f/a68726c9ca88ce1231741208e4b8d36a48d116517adc5520e5ac21a3281e/tg2ext.express-0.2.9.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "5350409ad513b0a1f150981688e52b53", "sha256": "d20bc0e993461c55585da1b159638c93fff8e7e87b9ffa1b7803505c1c0568d3" }, "downloads": -1, "filename": "tg2ext.express-0.3.0.tar.gz", "has_sig": false, "md5_digest": "5350409ad513b0a1f150981688e52b53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14901, "upload_time": "2014-05-15T08:44:56", "url": "https://files.pythonhosted.org/packages/51/a1/0a145bfd8d7afa8c7ff6a422252842684559bfe23f3533e60315a7b8dc01/tg2ext.express-0.3.0.tar.gz" } ], "0.3.1-dev": [ { "comment_text": "", "digests": { "md5": "6171abbfc03550ef3a6feda06f5bc7ee", "sha256": "78ac2b1fb6f0dcb2148086171f8a36e9ed1efde8d8495d3315e6da36d045e7b1" }, "downloads": -1, "filename": "tg2ext.express-0.3.1-dev.tar.gz", "has_sig": false, "md5_digest": "6171abbfc03550ef3a6feda06f5bc7ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15549, "upload_time": "2014-05-26T01:57:01", "url": "https://files.pythonhosted.org/packages/23/cd/85370488aacf06e4876af09953302dbfab266f3643c5240fb59aeb623a76/tg2ext.express-0.3.1-dev.tar.gz" } ], "0.3.2-dev": [ { "comment_text": "", "digests": { "md5": "a498f11f3f395b29981751ee9149c1c2", "sha256": "489a61a2863f9b8bb4192fc2b3bccc9185e9ea76854b12ab018feb3c8a46106a" }, "downloads": -1, "filename": "tg2ext.express-0.3.2-dev.tar.gz", "has_sig": false, "md5_digest": "a498f11f3f395b29981751ee9149c1c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15545, "upload_time": "2014-06-03T03:55:13", "url": "https://files.pythonhosted.org/packages/4a/f3/bdf1d252186481d1d57567c57024e878808496b4c25db4d1a62d40ec082c/tg2ext.express-0.3.2-dev.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5350409ad513b0a1f150981688e52b53", "sha256": "d20bc0e993461c55585da1b159638c93fff8e7e87b9ffa1b7803505c1c0568d3" }, "downloads": -1, "filename": "tg2ext.express-0.3.0.tar.gz", "has_sig": false, "md5_digest": "5350409ad513b0a1f150981688e52b53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14901, "upload_time": "2014-05-15T08:44:56", "url": "https://files.pythonhosted.org/packages/51/a1/0a145bfd8d7afa8c7ff6a422252842684559bfe23f3533e60315a7b8dc01/tg2ext.express-0.3.0.tar.gz" } ] }