{ "info": { "author": "dracarysX", "author_email": "huiquanxiong@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "peewee-rest-query\n===================\n\nA rest query request args parser for peewee orm. like no-sql select style.(/?select=id,name,author{*}&id=gte.20&order=id.desc).\n\nInstalling\n------------\n\n``pip install peewee-rest-query``\n\nTest\n------------\n\n``python setup.py test``\n\nUsage\n------------\n\nUsage::\n\n > from peewee_rest_query import PeeweeQueryBuilder, PeeweeSerializer\n > class School(Model):\n id = PrimaryKeyField()\n name = CharField(max_length=100)\n\n > class Author(Model):\n id = PrimaryKeyField()\n name = CharField(max_length=50)\n age = IntegerField(default=0)\n school = ForeignKeyField(School)\n\n > class Book(Model):\n id = PrimaryKeyField()\n name = CharField(max_length=255)\n author = ForeignKeyField(Author)\n\n > args = {\n 'select': 'id,name,author{id,name,school{*}}',\n 'id': 'gte.20',\n 'author.id': 'in.10,20,30,40,50',\n 'order': 'id.desc',\n 'page': 1,\n 'limit': 5\n }\n > builder = PeeweeQueryBuilder(Book, args)\n > builder.select\n [, , , , ]\n > build.where\n [, ]\n > builder.order\n []\n > builder.paginate\n (1, 5)\n > builder.build()\n SELECT \"t3\".\"id\", \"t3\".\"name\", \"t2\".\"id\", \"t2\".\"name\", \"t1\".\"id\", \"t1\".\"name\" FROM \"book\" AS t1 INNER JOIN \"author\" AS t2 ON (\"t1\".\"author_id\" = \"t2\".\"id\") INNER JOIN \"school\" AS t3 ON (\"t2\".\"school_id\" = \"t3\".\"id\") WHERE ((\"t1\".\"id\" >= ?) AND (\"t2\".\"id\" IN (?, ?, ?, ?, ?))) ORDER BY \"t1\".\"id\" DESC LIMIT 5 OFFSET 0 [20, 10, 20, 30, 40, 50]\n\n\nLicense\n----------\n\nMIT\n\nContacts\n----------\n\nEmail: huiquanxiong@gmail.com", "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/dracarysX/peewee-rest-query", "keywords": "rest,query,no-sql,parser,peewee", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "peewee-rest-query", "package_url": "https://pypi.org/project/peewee-rest-query/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/peewee-rest-query/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/dracarysX/peewee-rest-query" }, "release_url": "https://pypi.org/project/peewee-rest-query/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "A rest query request args parser for peewee orm.", "version": "0.1.0" }, "last_serial": 2983971, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "c19f4f70c3e9e84fcfd84a72dfa484c0", "sha256": "1b876d5e32d7b45a6def3f2e5fccfe6544677ac750c054ebfe2292b4da5b6f0c" }, "downloads": -1, "filename": "peewee-rest-query-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c19f4f70c3e9e84fcfd84a72dfa484c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4249, "upload_time": "2017-06-28T06:13:57", "url": "https://files.pythonhosted.org/packages/01/cb/05d5f3b43309bf99d94908072440be43abe1716b292a0806a81031178bc8/peewee-rest-query-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c19f4f70c3e9e84fcfd84a72dfa484c0", "sha256": "1b876d5e32d7b45a6def3f2e5fccfe6544677ac750c054ebfe2292b4da5b6f0c" }, "downloads": -1, "filename": "peewee-rest-query-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c19f4f70c3e9e84fcfd84a72dfa484c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4249, "upload_time": "2017-06-28T06:13:57", "url": "https://files.pythonhosted.org/packages/01/cb/05d5f3b43309bf99d94908072440be43abe1716b292a0806a81031178bc8/peewee-rest-query-0.1.0.tar.gz" } ] }