{ "info": { "author": "lwaix", "author_email": "1494645263@qq.com", "bugtrack_url": null, "classifiers": [], "description": "##### [\u4e2d\u6587-Chinese](https://github.com/lwaix/Pmorm/blob/master/README-zh.md \"\u4e2d\u6587-Chinese\")\n\n# pmorm.py - a simple mysql orm for python3\n\n![](https://img.shields.io/badge/python-3.5-red.svg)\n\n![](https://img.shields.io/badge/license-MIT-green.svg)\n\nFunctional overview\n\n- Model-Oriented operations\n- Basic CRUD\n- Operator query\n- Automatic safety escape\n\n## Installing\n\n```\nshell>pip install Pmorm\n```\n\n## Basic\n\n```python\nfrom pmorm import Mysql\n\n# Create a connection.Automatically create database(if it is not created)\ndb = Mysql('localhost', 'root', 'your-password', 'testdb1')\n\nclass Worker(db.Model):\n __table__ = 'worker'\n\n id = db.PrimaryKeyField()\n username = db.VarcharField(max_length=32, nullable=False, unique=True, default=None, comment=\"Worker's username\")\n password = db.VarcharField(max_length=32, nullable=False, unique=False, default=None, comment=\"Worker's password\")\n salary = db.FloatField(nullable=False, unique=False, default=0.0, comment=\"Worker's monthly salary\")\n\nWorker.create_table()\n\n# Insert\njack = Worker(username='Jack', password='JackSoHandsome', salary=3999.2)\njack.insert()\n\nmary = Worker()\nmary.username = 'Mary'\nmary.password = 'MarySoBeautiful'\nmary.insert()\n\n# Get all and get the first\nall_workers = Worker.select().all()\nthe_first_worker = Worker.select().first()\n\n# Query by operators\nrich_workers = Worker.select(Worker.salary>=3000.0).all()\n\n# Complex query by operators & and |\nworker_jack = Worker.select(\n\t((Worker.username == 'jack') & (Worker.password == 'JackSoHandsome')) | (Worker.salary=='3999.2')\n).first()\n\n# Order the rows\nthe_richest_worker = Worker.select(orders=[-Worker.salary]).first()\n\n# Use the result\nfor worker in all_workers:\n\tprint('username:{} password:{} salary:{}'.format(worker.username, worker.password, worker.salary))\nprint('And the richest worker is {}'.format(the_richest_worker.username))\n\n# Update one row\nworker_jack.salary = 3000.0\nworker_jack.update()\n\n# Delete one row\nworker_jack.delete()\n```\n\n## Else\n\n### Currently supported MySQL fields\n\nPmorm|Mysql\n--|:--:\nPrimaryKeyField|NO\nBooleanField|BOOLEAN\nIntField|INT\nBigIntField|BIGINT\nFloatField|FLOAT\nDoubleField|DOUBLE\nVarcharField|VARCHAR\nTextField|TEXT\n\nPrimaryKeyField must be defined in each model, so a basic model looks like...\n\n```python\nmydb = Mysql('localhost', 'root', 'your-passwd', 'your-database')\nclass ModelName(mydb.Model):\n __table__ = 'mytable'\n\n id = mydb.PrimaryKeyField()\n # Other fields...\n```\n\n", "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/lwaix/Pmorm", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "Pmorm", "package_url": "https://pypi.org/project/Pmorm/", "platform": "", "project_url": "https://pypi.org/project/Pmorm/", "project_urls": { "Homepage": "https://github.com/lwaix/Pmorm" }, "release_url": "https://pypi.org/project/Pmorm/0.21/", "requires_dist": [ "PyMySQL" ], "requires_python": "", "summary": "A simple mysql orm for python3", "version": "0.21" }, "last_serial": 4920390, "releases": { "0.15.2": [ { "comment_text": "", "digests": { "md5": "a0786943d109924ab60e90589e947d5e", "sha256": "0cdc0a291a0d7586b5062459052a8491c5cc1635f7b8252deefc116d2e9a2062" }, "downloads": -1, "filename": "Pmorm-0.15.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a0786943d109924ab60e90589e947d5e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8040, "upload_time": "2019-02-16T12:32:01", "url": "https://files.pythonhosted.org/packages/80/56/e99d27132f1404837bdc74960365452dc2a03886b796d96d1ef3f9ded5cf/Pmorm-0.15.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5b1906788f7dced413387cfaf49db0ca", "sha256": "688707efe1b114be7264714b9df6d2d9899692822f3bdb0776394391407367c9" }, "downloads": -1, "filename": "Pmorm-0.15.2.tar.gz", "has_sig": false, "md5_digest": "5b1906788f7dced413387cfaf49db0ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7652, "upload_time": "2019-02-16T12:32:04", "url": "https://files.pythonhosted.org/packages/57/26/dcde71c4ecac19b02a108703fce24dc5b7a9c73d85320e917693e8f07801/Pmorm-0.15.2.tar.gz" } ], "0.15.4": [ { "comment_text": "", "digests": { "md5": "2b49eb6bacc1849c738c0e05149853a0", "sha256": "49db039fadf4b07034a5a6b23fd54b7ed0252e2ba8bab4b765119795637ceb2e" }, "downloads": -1, "filename": "Pmorm-0.15.4-py3-none-any.whl", "has_sig": false, "md5_digest": "2b49eb6bacc1849c738c0e05149853a0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8231, "upload_time": "2019-02-19T12:31:24", "url": "https://files.pythonhosted.org/packages/56/f7/b32a6bfe785408653e8f98b58870568b1327f7ca97dbd908288db1457d81/Pmorm-0.15.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2d113972c3ef347ac41a99a66514710b", "sha256": "ed70384c8e6dd590189ca5603b31305c7ba1b8a6c15ae8bddf9e28997f7323ba" }, "downloads": -1, "filename": "Pmorm-0.15.4.tar.gz", "has_sig": false, "md5_digest": "2d113972c3ef347ac41a99a66514710b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8985, "upload_time": "2019-02-19T12:31:26", "url": "https://files.pythonhosted.org/packages/86/9b/6706edb9866f5df974a0190ae25f710f4ff7d18d18d57aa0c7e8d6a3a9e7/Pmorm-0.15.4.tar.gz" } ], "0.17": [ { "comment_text": "", "digests": { "md5": "c596fbc9741c94eae13b5c33a2914609", "sha256": "786f94860fee45884e195e5ed5c96022eae8f3ea3bfe39418dd2029d59a1e197" }, "downloads": -1, "filename": "Pmorm-0.17-py3-none-any.whl", "has_sig": false, "md5_digest": "c596fbc9741c94eae13b5c33a2914609", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8111, "upload_time": "2019-02-20T12:05:07", "url": "https://files.pythonhosted.org/packages/02/85/928097003d2e9dd1bde8a9919f6ae2e36de09e9cc197a3ed9e86e6e410fc/Pmorm-0.17-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "437479ee70a8f3f8327eb19766ddfd44", "sha256": "807693981bf96809ebc74a7a0aa7d9b10c8afdde16546b105d38e3b79f4c1819" }, "downloads": -1, "filename": "Pmorm-0.17.tar.gz", "has_sig": false, "md5_digest": "437479ee70a8f3f8327eb19766ddfd44", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8884, "upload_time": "2019-02-20T12:05:09", "url": "https://files.pythonhosted.org/packages/b2/23/2584d1588f4137e6a6164cff95ee08ac00980296c1ab19c3adb12e4fd941/Pmorm-0.17.tar.gz" } ], "0.20": [ { "comment_text": "", "digests": { "md5": "f58679aaf396fcb5898ab20401ea208e", "sha256": "381f5c79498d771d475093a730fa9a9e0ae0633dbc1fe56e416c17eff7d90389" }, "downloads": -1, "filename": "Pmorm-0.20-py3-none-any.whl", "has_sig": false, "md5_digest": "f58679aaf396fcb5898ab20401ea208e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7562, "upload_time": "2019-03-02T10:46:33", "url": "https://files.pythonhosted.org/packages/d3/f7/e366829f11e7c965ab6ed63984bb24369de514c297aaab96b087a4cd4e1a/Pmorm-0.20-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "112f1ff4d5f876ff7ea225e9c4dff601", "sha256": "d96e339b39d42ea1e0903d308e5dc1ccafc2745ab0156c4bcf6cb3ab5d531c89" }, "downloads": -1, "filename": "Pmorm-0.20.tar.gz", "has_sig": false, "md5_digest": "112f1ff4d5f876ff7ea225e9c4dff601", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6601, "upload_time": "2019-03-02T10:46:34", "url": "https://files.pythonhosted.org/packages/12/b1/670c2729692806c52b8f4d92da741783cb4695be71431674501d274ccefd/Pmorm-0.20.tar.gz" } ], "0.21": [ { "comment_text": "", "digests": { "md5": "455dfbc32e2b27dd8d2c91d7aa3660f2", "sha256": "89994f2caa334c3d56570a189d8fbfc74450dff87a1567c5d36a8115541abfe6" }, "downloads": -1, "filename": "Pmorm-0.21-py3-none-any.whl", "has_sig": false, "md5_digest": "455dfbc32e2b27dd8d2c91d7aa3660f2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7671, "upload_time": "2019-03-10T04:21:12", "url": "https://files.pythonhosted.org/packages/df/70/8e94d114ff39273f03d039d16e50143f1a1377898fab73e1b1163db9fdc8/Pmorm-0.21-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "67300fc4f87a3fecfaad357a16499899", "sha256": "2f63f2201de3d191faf12749e7511ff5035cb95f7237ac66223dbbd1cf4ca5b0" }, "downloads": -1, "filename": "Pmorm-0.21.tar.gz", "has_sig": false, "md5_digest": "67300fc4f87a3fecfaad357a16499899", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7763, "upload_time": "2019-03-10T04:21:14", "url": "https://files.pythonhosted.org/packages/da/84/c493dbc11f1f42a2075f7f07bf6a6a9ba585ef4a5cd4c7e64df730b8f7ec/Pmorm-0.21.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "455dfbc32e2b27dd8d2c91d7aa3660f2", "sha256": "89994f2caa334c3d56570a189d8fbfc74450dff87a1567c5d36a8115541abfe6" }, "downloads": -1, "filename": "Pmorm-0.21-py3-none-any.whl", "has_sig": false, "md5_digest": "455dfbc32e2b27dd8d2c91d7aa3660f2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7671, "upload_time": "2019-03-10T04:21:12", "url": "https://files.pythonhosted.org/packages/df/70/8e94d114ff39273f03d039d16e50143f1a1377898fab73e1b1163db9fdc8/Pmorm-0.21-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "67300fc4f87a3fecfaad357a16499899", "sha256": "2f63f2201de3d191faf12749e7511ff5035cb95f7237ac66223dbbd1cf4ca5b0" }, "downloads": -1, "filename": "Pmorm-0.21.tar.gz", "has_sig": false, "md5_digest": "67300fc4f87a3fecfaad357a16499899", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7763, "upload_time": "2019-03-10T04:21:14", "url": "https://files.pythonhosted.org/packages/da/84/c493dbc11f1f42a2075f7f07bf6a6a9ba585ef4a5cd4c7e64df730b8f7ec/Pmorm-0.21.tar.gz" } ] }